I have a multilingual website with translation by content directory.
So:
content/
├─ en/
│ ├─ blog
│ ├─ _index.md
│ ├─ post1.md
│ ├─ post2.md
│
├─ fr/
│ ├─ blog
│ ├─ _index.md
│ ├─ post1.md
│ ├─ post2.md
config.toml
[languages]
[languages.en]
contentDir = "content/en"
[languages.fr]
contentDir = "content/fr"
I want to iterate\loop over the posts in the blog in the current language (let’s say “en”), so I use:
{{ range where .Site.RegularPages "Section" "blog" }}
...
… and it doesn’t work because it turns out that sections are “en” and “fr”.
“blog” is subsection.
How to perform seamless iteration (I mean, considering the current language and only with its posts)?
What’s the best practice when dealing with i18n in that case?
thx!