kurtsson / jekyll-multiple-languages-plugin

I18n support for Jekyll and Octopress
MIT License
923 stars 201 forks source link

Different language on different posts #115

Open BenjaminHoegh opened 6 years ago

BenjaminHoegh commented 6 years ago

Possible to have different language in different posts? So maybe one post exist in English and Chinese, and another one in English and Italy

sunnypp commented 6 years ago

I second this idea.

Is there a way to hide "Change language link" if the post for that language doesn't exist?

Now I am using:

{% for lang in site.languages %}
      <a href="{{ site.baseurl_root }}/{{ lang }}{{ page.url }}" >{% t langs.{{ lang }} %}</a>
{% endfor %}
joshcummingsdesign commented 5 years ago

@BenjaminHoegh Am I mistaken in thinking this is already possible? For example, you can have a directory structure like this:

_i18n
├── en
│   └── _posts
│       └── hello.md
│       └── world-en-only.md
├── en.yml
├── es
│   └── _posts
│       └── hello.md
└── es.yml
joshcummingsdesign commented 5 years ago

@sunnypp Wouldn't that be the same principle as above? If the post doesn't exist in the target language, it falls back to the default language.

keunes commented 2 years ago

See also #72 ((blog) posts is a collection, I think)