First Step to Multilingual - one language in its subdir - How to do this?

Hi all,
I built up my website over the last two years. A multilingual configuration with only the first language activated. It’s done with Hugo and UiKit.
So I got: (lang independent files) (active de content) (empty)

Now I do a refactoring and bring it to I will make a translation to en in next months or so.

Here is my question to sitemap and sitemapindex in this setting.
Q: At the moment I set disableLanguages = [“en”] then my output is going flat to the root. When I strip ‘disableLanguages = [“en”]’ away then I get the layout above back.
I would like to see always and stable: (lang independent files) (active de content)
And after translation the additional “”

– Here my config.toml (language parts) –

disableLanguages = ["en"]
DefaultContentLanguage = "de"
DefaultContentLanguageInSubdir = "true"

languageName = "De"
languageCode = "de"
contentDir = "content/de"
weight = 1
languageName = "En"
languageCode = "en"
contentDir = "content/en"
weight = 2
description = "xxx en"

I tried many combinations. So if someone has an experience it would be really helpful!


I think you are running into this known defect:

Hi jmooring,
thank you for the hint!
Yes, it looks exactly like this bug.

So, I will do a manual workaround. It’s not a big thing for some time.
Problem “solved”!


I think you could add this (a dummy langauge) to workaround the problem:

contentDir = 'content/xx'
disableKinds = ['home','page','section','taxonomy','term','RSS','sitemap']
weight = 99

Perfect, an automatic workaround.

I checked it. What is left at the end is:
The default iterates over the languages and produces links to “de” and “en”.
So, a modified sitemapindex template would do eventually the job?

I’ve a final automatic solution.
Strip the “en” link in the index sitemap.xml.
Then move it to the static directory.

After a build, I have three things: with the modified index sitemap.xml in the root with the "de" sitemap.xml
no "en" directory.

Just perfect :slight_smile:

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