Jekyll: assigning a variable to a post on a for loop -
i'm trying create multilingual website company, and, because have lot of information, i'd include information in french , in english in same post so:
en: title: "english stuff" fr: title: "french stuff"
the thing is, in order use them dynamically in same layout using this,
{{ post.[post.lang].title }}
i wanted assign
variable when for
ed them, automatically assign language wanted on posts, like:
{% post in site.categories.yesterday %} {% assign lang = en %} <li><h2><a href="{{ post.url }}">{{ post.lang.title }}</a><h2></li> {% endfor %}
is doesn't seem working (the titles not rendered), wanted ask opinion. the viable way it? doing wrong , can improve it?
the easiest solution build separate sites on separate domains. not dry, simple solution. google tell same.
however, if have website requires changes/evolves on time, 'not being dry' part might become frustrating. reason use internationization plugin.
Comments
Post a Comment