You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
First of all, thank you so much for this plugin, great job!
I have encountered an issue, that when I use the i18n filter with liquid templates, eleventy throws an error.
I used the plugin demo code to reproduce the error, so I'm quite sure it's not my project. What I did was that I added {{ 'hello' | i18n }} to the file index.njk located in en-gb/ to test the filter and see if it picks up the translation from i18n/index.js
So what happens is, that if I run eleventy on the plugin demo code, it runs smooth as expected and serves the generated pages.
However, if I save the index.njk as a liquid template index.liquid and explicitly tell eleventy to use liquid as templating engine, I run into the following error:
> Having trouble rendering liquid template ./src/en-gb/index.liquid
`TemplateContentRenderError` was thrown
> Cannot read property 'page' of undefined, file:./src/en-gb/index.liquid, line:3
`RenderError` was thrown
> Cannot read property 'page' of undefined
`TypeError` was thrown:
TypeError: Cannot read property 'page' of undefined
at /home/kati/git/eleventy-plugin-i18n-demo-master/node_modules/eleventy-plugin-i18n/.eleventy.js:16:40
at /home/kati/git/eleventy-plugin-i18n-demo-master/node_modules/@11ty/eleventy/src/BenchmarkGroup.js:30:26
at Object.render (/home/kati/git/eleventy-plugin-i18n-demo-master/node_modules/liquidjs/dist/liquid.common.js:1914:26)
at /home/kati/git/eleventy-plugin-i18n-demo-master/node_modules/liquidjs/dist/liquid.common.js:1807:21
at Array.reduce (<anonymous>)
at Object.evalValue$$1 [as evalValue] (/home/kati/git/eleventy-plugin-i18n-demo-master/node_modules/liquidjs/dist/liquid.common.js:1806:29)
at Object._callee4$ (/home/kati/git/eleventy-plugin-i18n-demo-master/node_modules/liquidjs/dist/liquid.common.js:1786:30)
at tryCatch (/home/kati/git/eleventy-plugin-i18n-demo-master/node_modules/liquidjs/dist/liquid.common.js:108:40)
at Generator.invoke [as _invoke] (/home/kati/git/eleventy-plugin-i18n-demo-master/node_modules/liquidjs/dist/liquid.common.js:319:22)
at Generator.prototype.<computed> [as next] (/home/kati/git/eleventy-plugin-i18n-demo-master/node_modules/liquidjs/dist/liquid.common.js:156:21)
Wrote 0 files in 0.09 seconds (v0.11.1)
I didn't change anything else, just renaming the index.njk to index.liquid and putting liquid instead of njk as value for markdownTemplateEngine in .eleventy.js
My eleventy version is 0.11.1, the plugin version is 0.1.0
What am I missing here?
Cheers
Katrin
The text was updated successfully, but these errors were encountered:
Hi!
First of all, thank you so much for this plugin, great job!
I have encountered an issue, that when I use the i18n filter with liquid templates, eleventy throws an error.
I used the plugin demo code to reproduce the error, so I'm quite sure it's not my project. What I did was that I added
{{ 'hello' | i18n }}
to the file index.njk located in en-gb/ to test the filter and see if it picks up the translation from i18n/index.jsSo what happens is, that if I run eleventy on the plugin demo code, it runs smooth as expected and serves the generated pages.
However, if I save the index.njk as a liquid template index.liquid and explicitly tell eleventy to use liquid as templating engine, I run into the following error:
I didn't change anything else, just renaming the index.njk to index.liquid and putting liquid instead of njk as value for markdownTemplateEngine in .eleventy.js
My eleventy version is 0.11.1, the plugin version is 0.1.0
What am I missing here?
Cheers
Katrin
The text was updated successfully, but these errors were encountered: