Hi,
I’m still learning to properly use I18n (and Middleman), so please have understanding. I’m using frontmatter in a mypage.html.erb
to send page-title to the layout.erb
, using title: My Page Title
in page’s frontmatter and <title><%= current_page.data.title %></title>
in my layout code. This is a correct way, right?
Now, I’m using I18n to localize my page to several languages. If I use the entire-template-localizing approach this is fine, since each page.en.erb
/ page.de.erb
/ …
contains its own localized frontmatter. But if I don’t want to use entire-template-localizing approach and use en.yml
/ de.yml
instead, then how do I deliver page-title to the layout? Is there a way to use t(:symbol)
in frontmatter?
The question is more general, because I use frontmatter not only for the title
tag but also to set description metadata, menu title for navigation (sometimes must be shorter than the full page title), etc.