summaryrefslogtreecommitdiffstats
path: root/hugolib
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-05-28 18:42:10 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-05-28 18:42:10 +0200
commite3dfc76fa8665562798b1e89abc2aa0e9141b1fa (patch)
tree59e3f3f747e0f78d4815100067a9e67fc51fa583 /hugolib
parentcd59216de470874b3f9a71e72418bc381539fdd0 (diff)
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
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/config_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/hugolib/config_test.go b/hugolib/config_test.go
index f742eb862..a8e3b8f2c 100644
--- a/hugolib/config_test.go
+++ b/hugolib/config_test.go
@@ -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|")
+
+}