I18n of the index.md slug?

I have /content/projekti/ folder with: index.md and index.en.md (english is secondary language).

Generated files are: /projekti/index.html and /en/projekti/index.html.

I want to change the former name to: /en/projects/index.html. If I set the slug in index.en.md it will be added to the path:

/en/projekti/<slug>/index.html

Obviously, I want value to replace the projekti name for english translation.

How to do so?

The only way i was able to do so is by setting the url which I dont consider to be a good solution.

Another approach might be to change the content directory on each language like https://gohugo.io/content-management/multilingual/#translation-by-content-directory. Maybe you need to bypass the translation on front matter.

Not sure how this will change anything? This way the language variants are just in different folders, that is all; the same logic applies.

Your content folder will look like that: content/fr/projekti/index.md and content/en/project/index.md, the final URL will keep the folder structure name by language.

Ongoing issue: https://github.com/gohugoio/hugo/issues/4870

At the moment url is your safest bet, unfortunately.

1 Like