Closed borisschapira closed 6 years ago
@borisschapira Thank you trying this plugin.
Your understanding of the "Manual mode" is slightly incorrect. Files are matched by their relative_paths
. slug
is an attribute of their internal representation.
For example, if my site's default locale is fr
and i'd like to generate a localized post for locale en
, then my directory structure would resemble:
_config.yml
_posts
2018-10-01-Bonjour.md
_locales
en
_posts
2018-10-01-Bonjour.md
with _locales/en/_posts/2018-10-01-Bonjour.md
containing following in the front matter
---
title: Hello World
slug: hello # define this to fashion your post's URL
---
The above will result in:
_site/2018/10/01/bonjour.html
_site/en/2018/10/01/hello.html
The reason I chose to match relative_paths was because it is more efficient (memory-wise) to check if a certain path exists on the file system and then attempt to read the file, instead of first reading all files and then filtering instances out based on their internal attribute..
That said, I understand its not easy to rename 1000+ posts and move them to sub directories for every locale, especially for users of jekyll-postfiles
who have a different directory structure for posts in comparison with the conventional approach..
Thanks for this answer, I should be able to modify my files without sweating: I have everything I need to handle them. I'll test jekyll-locale tomorrow with this and tell you how it goes.
Let me know if the README needs more clarity..
Hi! I'm overhyped by this new plugin, managing localization by myself for several months (years maybe?). As I understand the current "Manual mode", localized posts are matched by their slug. Would it be possible to choose how they're matched? In my case, English and French version do not share the same slug at all:
The matching between them being made by a key:
i18n-key
.Could we imagine another iteration of the plugin, allowing user to configure the way the posts are matched? Something like:
That could be modified to:
That would be fantastic.