-
Notifications
You must be signed in to change notification settings - Fork 75
Description
Context
I want to be able to have different URLs for posts in different languages. e.g:
- /en/my-post/
- /fr/mon-article/
- /de/mein-blogartikel/
Today, this is possible to do it thanks to the page_id in the front matter of the post.
However, for this to work, you'll need to specify a permalink for each post, which is quite annoying.
Why? Because, if you can easily forget to enter this attribute and then switching from one language to another won't work.
In Jekyll, you can add a default permalink attribute for all the pages. However, this doesn't seem to be taken into account by polyglot. Thus accessing the permalink through permalink_lang[lang] doesn't work.
Experiments
What I tried so far, was to create a language selector that would retrieve all the site.posts and site.pages.
Why? Because, I wanted to access the url attribute of a post/page in another language.
However, these are already filtered out by polyglot before I access them.
Thus it's impossible to get this url attribute.
This is confirmed by these issues: 186, 53, 88.
Ideas
Reading issue 186, it seems there is no will to implement it.
However, is there any other way to get these URLs?
Would it be possible to implement an attribute url_lang similar to the permalink_lang?
Thanks for any advice.