datocms / middleman-dato

A Middleman extension to integrate your website with DatoCMS
https://docs.datocms.com/middleman/overview.html
MIT License
24 stars 7 forks source link

Access global settings #2

Closed hanno-jonlay closed 7 years ago

hanno-jonlay commented 7 years ago

Hey guys

I don't believe this is currently possible, or at least it just hasn't been documented. Could you explain how to access DatoCMS data that's inside Content > Settings, using this gem. i.e. this page: https://xxxx.admin.datocms.com/editor/settings

I'd propose:

<%= dato.settings %>

And also that the following helper should generate all the meta settings:

<%= dato_meta_tags(settings) %>
stefanoverna commented 7 years ago

You can access to site settings like this:

dato.site.global_seo
dato.site.favicon
dato.site.name
dato.site.locales
stefanoverna commented 7 years ago

dato_meta_tags already uses the site settings to generate SEO metadata

hanno-jonlay commented 7 years ago

Thanks for your help! I've also done a quick PR to make that clearer in the README for anyone else.