Support multiple languages while forcing /{language}/path for default langauge as well

Hello, I’ve been reading the code in the hugoDocs repo as well as the documentation, but I’m struggling to figure out how to force the default language code (e.g. “en”) to still keep the /en/ in its path.
My code is basically the same as what you see here: hugoDocs/config/_default/menus at master · gohugoio/hugoDocs · GitHub, except for menus.en.toml then I write:

  name = "About Hugo"
  weight = 1
  identifier = "about"
  url = "/en/about/"

instead of url = /about/.

The problem is that even though the English content is placed under a directory called en in the content directory, then it can only resolve localhost:1313/about/ and not localhost:1313/en/about/. It can only resolve localhost:1313/en/about/ if I change defaultContentLanguage to something other than en, but then English of course won’t be the primary content loaded when visiting localhost:1313.

Any help would be much appreciated :slight_smile:

Have you tried defaultContentLanguageInSubdir: true ? See: Multilingual Mode | Hugo / Configure Hugo | Hugo

1 Like

Not sure how I missed that… thanks a lot :heart:

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