-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
This isn't anything recent... the problem has been present since v0.119.0.
Background
In a multihost configuration, when you run hugo server, the console displays something like:
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1) en
Web Server is available at http://localhost:1314/ (bind address 127.0.0.1) de
We added the language key to the end of each line in v0.119.0 via #11442.
Problem
If the default content language does not correspond to the first site by weight (or language key fallback), the wrong language key is displayed at the end of each line.
Example
defaultContentLanguage = 'en'
[languages.de]
baseURL = 'https://de.example.org/'
weight = 1
[languages.en]
baseURL = 'https://en.example.org/'
weight = 2
When I run hugo server I see this in the console:
Web Server is available at http://localhost:1314/ (bind address 127.0.0.1) en
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1) de
But http://localhost:1314/ is serving the DE site, while http://localhost:1313/ is serving the EN site.
Commentary
It seems like this, and similar areas of the code base, would be a lot simpler if the default content language were hardcoded to the the lightest weighted/sorted language. I guess I've never understood the use case for the configuration above.