-
I'm currently building my webpage with jekyll. It is supposed to have multiple categories for posts (I want to able to separate stuff like pictures taken on a holiday from a portfolio, etc.), as well as three languages... It's not easy if you have friends all over the world (and hope to reach potential clients all over the world too). I was able to solve the multilingual aspect quite nicely with collections, as described here: https://www.kooslooijesteijn.net/blog/multilingual-website-with-jekyll-collections. It boils down to creating a collections_dir, with multiple collections in it, one for each language. But now I want to add pagination. So far, all the guides I found for adding pagination with jekyll-pagination seem to imply that the website has only one language. By that I mean:
correct me if I'm wrong, but it seems to me, this will result in all the new files being written into same subdir. This breaks my existing data structure, which looks like this: Is there a way to have a separate pagination template for each of my collections (languages)? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
I would appreciate all and any help here. Overall, I've been struggling to make jekyll work for me for months, without much success. What I need:
I have read the docs on jekyllrb.com and watched videos on youtube, but nothing works as the information always seems to be either incomplete, ambiguous, or tailored to single-language websites. I can get either one of those things working: multiple languages and categories, OR pagination with just one category and language. If I try to use pagination with multiple languages in place, no posts are being displayed. Jekyll does not log any errors and my posts are generated and look fine inside _site folder. |
Beta Was this translation helpful? Give feedback.
-
OK, I have figured out, that my data structure was completely wrong and collections were not actually working, because I named the subfolders of "content" without a leading "_". Now, my multilingual setup is not only working, but actually leveraging collections this time. AFAIK my _posts directory is in the right place, please correct me if I'm wrong. This is how the data structure looks like right now: However, after installing, enabling and configuring jekyll-paginate-v2 plugin, when I run
Yet, all the pages I need pagination on, have the following in their front matter:
So I assumed, the plugin is not finding my pages, because all of them are "hidden" inside the collections. Inside _config.yml I then configured the following:
as to make sure pagination is enabled for all collections. Still same behaivour. I see no posts, because the paginator is not finding any pages with enabled pagination (but they exist inside my collections). I just don't have a single page in the root of the website, it's all under the collections and the root of my website only includes an index.html which attempts to guess preferred language and sends the visitor to correct place |
Beta Was this translation helpful? Give feedback.
-
so finally, everything works. The actual problem was that guide that I followed. Somehow the link above seems broken, so here it goes again: problematic multilang guide Multilinguality is not covered as such on the jekyll main page, so I just searched online. This is the type of headache that you get for not using official ressources... When using polyglot and paginate-v2 everything works easily and without any problems. Multiple languages, pagination, no misuse of collections for separating your multilingual content and even a key: values list for automatically translating often used words. |
Beta Was this translation helpful? Give feedback.
so finally, everything works. The actual problem was that guide that I followed. Somehow the link above seems broken, so here it goes again: problematic multilang guide
Multilinguality is not covered as such on the jekyll main page, so I just searched online. This is the type of headache that you get for not using official ressources...
When using polyglot and paginate-v2 everything works easily and without any problems. Multiple languages, pagination, no misuse of collections for separating your multilingual content and even a key: values list for automatically translating often used words.