I have a website with multi language and several content folders. Currently the most content folders us this technique:
/posts/hello.en.md
/posts/hello.fr.md
...
Now I have another content type where I would like to use only one md file but βexportβ them in each language available in the project. So I want to have these content structure:
/persons/mark.md
/persons/lisa.md
...
But export it to each language. Currently it only exports (like the default behavior) in the default language. How can I active that each person is exported in the multilanguage but only has one content file?
Move the persons directory outside of the content directory, then mount it by language.
content/
βββ posts/
β βββ _index.en.md
β βββ _index.fr.md
β βββ hello.en.md
β βββ hello.fr.md
βββ _index.en.md
βββ _index.fr.md
persons/
βββ _index.md
βββ lisa.md
βββ mark.md
site config
[[module.mounts]] # Default mount; do not omit
source = 'content'
target = 'content'
[[module.mounts]]
source = 'persons'
target = 'content/persons'
lang = 'en'
[[module.mounts]]
source = 'persons'
target = 'content/persons'
lang = 'fr'
example
git clone --single-branch -b hugo-forum-topic-46998 https://github.com/jmooring/hugo-testing hugo-forum-topic-46998
cd hugo-forum-topic-46998
hugo server
Thank! Tooke me 1 minute to make it work! 