Skip to content

fix: resolve Hugo v0.158.0 build failures in multilingual sites#298

Merged
markdumay merged 2 commits intomainfrom
develop
Mar 19, 2026
Merged

fix: resolve Hugo v0.158.0 build failures in multilingual sites#298
markdumay merged 2 commits intomainfrom
develop

Conversation

@markdumay
Copy link
Copy Markdown
Collaborator

Replace deprecated site.LanguageCode with site.Language.Lang in GetStaticURL. In Hugo v0.158.0, the language configuration refactor changed site.LanguageCode to return the global languageCode value (e.g. "en-us") instead of the language key (e.g. "en"), breaking the strings.TrimSuffix used to derive the base URL from site.Home.RelPermalink.

site.Language.Lang always returns the language key matching the URL prefix, making this both a correct and backwards-compatible fix.

markdumay and others added 2 commits March 19, 2026 16:37
Replace deprecated site.LanguageCode with site.Language.Lang in
GetStaticURL. In Hugo v0.158.0, the language configuration refactor
changed site.LanguageCode to return the global languageCode value
(e.g. "en-us") instead of the language key (e.g. "en"), breaking the
strings.TrimSuffix used to derive the base URL from site.Home.RelPermalink.

site.Language.Lang always returns the language key matching the URL
prefix, making this both a correct and backwards-compatible fix.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@markdumay markdumay enabled auto-merge March 19, 2026 15:38
@markdumay markdumay merged commit 43c3846 into main Mar 19, 2026
11 checks passed
@markdumay
Copy link
Copy Markdown
Collaborator Author

🎉 This PR is included in version 5.19.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant