Jekyll Liquid - accessing _config.yml dynamically

耗尽温柔 提交于 2019-12-01 20:31:48

With the way your vars are set, it would be something alog the lines of

{{ site.locales[site.default_locale][page.title] }}

The thing is, ... I don't really see the point of doing this. Let's say your page is the english page. The locale should then be defined within the page, and so should your title!

---
locale: en
title: My Wonderful Page
---

Which you can retrieve with {{ page.title }} ...

What could be the point of putting the title into the _config.yml file?

(edit) well unless you want to access page.title when in another page/post, in this case you have no choice but to put it into _config.yml.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!