Closed Clpsplug closed 2 years ago
Hello @Clpsplug 👋
If you don't specify permalinks, then polyglot tries it's best to associate posts by file path. Make sure your posts have the lang
specified (but you do say you have that). Jekyll will parse the date from the filename, but not the language suffix from the file.
If you look at these example files and how they're structured:
https://github.com/untra/polyglot/tree/master/site%2F_posts
That should generate a site directory like so, which I believe is what you're aiming for:
https://github.com/untra/polyglot/tree/master/site/_site
Specify posts under language folders, instead of with a language suffix.
Hello @untra! Yep, that was it. Seems like I misunderstood the "tries its best to associate posts by file path" part. I thought it can associate posts using literally any part of the path. Using the language directory fixed the problem! Thanks for the help!
Summary
For every page I need to be localized, I have been naming the files as follows, Japanese being the primary language for this site:
The
index
andworks
pages are localized correctly. I'm using the permalink method for these:The posts contain the following header; notice the lack of permalink because it does not make sense:
The problem is that the posts are not language-filtered as I expect. Both language versions of the article are included in both language versions of the site.
This behavior is causing my language switcher to work incorrectly on my posts page.
What I expected to happen
I expect that the
_site
directory would look like this:What happens instead
Steps to reproduce
jekyll new PATH --blank
_config.yaml
_site
directoryEnvironment
Jekyll-related
bundle install
output is as follows:Notes
I may be understanding something in the documentation wrong, but does it happen that the 'permalink' method and the 'filename' method cannot exist beside one another?