jekyll-locale icon indicating copy to clipboard operation
jekyll-locale copied to clipboard

Archive mix posts of different languages

Open guoyunhe opened this issue 5 years ago • 0 comments

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?

guoyunhe avatar Apr 28 '20 16:04 guoyunhe