-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting front matter variable permalink: false results in a compilation error #4
Comments
Thanks for the bug report, @unconfident. I understand the 2nd error case, and agree that using I'm not sure I follow the 1st scenario. If the 404 page was to be "placed in the |
Oh, sorry, I forgot to respond to your message.
Error pages are in many cases returned by the web server or maybe caching proxy / CDN and thus can only be served in one locale anyway. So I saw no reason to generate them for every language if only one is ever going to be used. With this in mind moving it a top level felt like a natural thing to do. I can name you at least three reasons why this can be desirable:
Because parts of the shared layout still depended on the i18n plugin and expect to find some localization variables I figured I would have to place the source file for the error page in the language specific directory and just swap the output path. You know the rest. |
Thanks for the additional info @unconfident. That helps me to better understand. Had created a hotfix for the Leads me to a question: #11 (comment) |
Not sure if this package is maintained anymore, but thought I would post this here in case anyone else runs into this: I used |
This code leads to problems in some situations when permalink is customized by the user.
eleventy-plugin-i18n/i18n.js
Lines 20 to 22 in e105338
Here are couple of examples:
1. permalink changed to a file in top level directory:
Locale becomes undetermined, even though page is placed in the "en" directory, Will be using fallback locale if specified
2. permalink set to false
Quoting original 11ty documentation here:
In this case compilation crashes with error:
TypeError: url.split is not a function
Proposed solution:
locale
variable. It's already suggested by the Readme to create directory data file (i.e.src/en/en.json
) with following contentspage.filePathStem
orpage.inputPath
instead ofpage.url
(see 11ty documentation) for parsing localeThe text was updated successfully, but these errors were encountered: