ashmaroli / jekyll-locale

A localization plugin for Jekyll
MIT License
19 stars 5 forks source link

Archive mix posts of different languages #19

Open guoyunhe opened 4 years ago

guoyunhe commented 4 years ago

In the website I am working on, it list all posts in the home page with pagination:

<!-- index.html -->
{% for post in paginator.posts %}
{% include single-post.html %}
{% endfor %}
{% include pagination.html %}

However, the result mix posts of different languages.

I can filter the array with {% if page.locale.id == post.locale.id %} but this will break the pagination.

In other locale pages, the archive is always empty:

<!-- _locales/zh-CN/index.html -->
{% for post in paginator.posts %}
{% include single-post.html %}
{% endfor %}
{% include pagination.html %}

Is here any better solution?