mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
Fix it so languageCode on top level config still works
This is common for monolingual sites, and we broke this in Hugo 0.112.4. Fixes #11037
This commit is contained in:
@@ -1044,3 +1044,25 @@ HTACCESS.
|
||||
b.AssertFileContent("public/.htaccess", "HTACCESS")
|
||||
|
||||
}
|
||||
|
||||
func TestConfigLanguageCodeTopLevel(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
files := `
|
||||
-- hugo.toml --
|
||||
languageCode = "en-US"
|
||||
-- layouts/index.html --
|
||||
LanguageCode: {{ .Site.LanguageCode }}|{{ site.Language.LanguageCode }}|
|
||||
|
||||
|
||||
`
|
||||
b := NewIntegrationTestBuilder(
|
||||
IntegrationTestConfig{
|
||||
T: t,
|
||||
TxtarString: files,
|
||||
},
|
||||
).Build()
|
||||
|
||||
b.AssertFileContent("public/index.html", "LanguageCode: en-US|en-US|")
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user