Use same content folder for one specific content

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
2 Likes

Thank! Tooke me 1 minute to make it work! :slight_smile:

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.