Dear Hugo community -
I’ve been struggling for some time and maybe this is a trivial mistake but looping through site.Sections gives a different collection depending on the language.
hugo.toml →
defaultContentLanguage = 'en'
defaultContentLanguageInSubdir = true
[languages]
[languages.en]
contentDir = 'content/en'
languageCode = 'pt'
languageName = 'English'
title = 'hugo.toml languages.en title'
weight = 10
[languages.en.params]
subtitle = 'hugo.toml languages.en.params subtitle'
[languages.pt]
contentDir = 'content/pt'
languageCode = 'pt'
languageName = 'Portugues'
title = 'hugo.toml languages.pt title'
weight = 20
[languages.de.params]
subtitle = 'hugo.toml languages.en.params subtitle'
Then a content structure that is the same for “en” and “pt” languages:
content/{en,pt}/{section1,section2,section3}
With each directory with their own _index.md
Rendering http://localhost:1313/en/ (the default language)
Rendering http://localhost:1313/pt/
This last one (e.g. a site.Sections collection with 3 sections) was the behaviour I hoped to get for both languages.
Could I be missing a configuration setting? It seems to be related to “en” because it’s the default?
Any pointers in the right direction would be much appreciated. Thank you for building Hugo.