polyglot
polyglot copied to clipboard
files in collections not translated without permalinks
I'm running into an issue where files with similar names, placed in the same collections folder, are not translated. The files differ by the language code suffix:
_recipes/2010-03-01-salad-recipes-en.md _recipes/2010-03-01-salad-recipes-fr.md
The files do get translated if provided a permalink in the YAML front matter, but my question is what could be the reason for polyglot to ignore the correct syntax? I understand correct file names should be enough to not manually specify the permalink for each file.
In general, if you do not assign a permalink, polyglot will assign one for you. If the files are not being translated appropriately when they lack a permalink, that can be a problem on my part.
Do you have a repo setup I can look at to help you debug? Are you remembering to set the lang:
frontmatter?
Yes, the lang: is always set. When I remove the permalink for apparently similar files (that differ by the suffix of the language separated with a dash) then both of the files ared rendered in the folders of both languages.
Atm it is not possible for me to provide access to a sample.
I have the same problem.
Hi, I solved this issue by combining include and force render.
Example with a _pages
collection with a test.md
:
_config.yml
is :
include:
- _pages
collections:
pages:
output: true
test.md
is :
---
myheader: foo
permalink: /test
lang: en
---
content
Result :