polyglot icon indicating copy to clipboard operation
polyglot copied to clipboard

files in collections not translated without permalinks

Open hannesaasamets opened this issue 7 years ago • 4 comments

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.

hannesaasamets avatar Aug 20 '17 10:08 hannesaasamets

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?

untra avatar Aug 26 '17 17:08 untra

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.

hannesaasamets avatar Aug 29 '17 12:08 hannesaasamets

I have the same problem.

vmohir avatar Apr 03 '19 20:04 vmohir

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 : image

Taknok avatar Apr 07 '21 13:04 Taknok