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 fored 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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -