summaryrefslogtreecommitdiffstats
path: root/hugolib
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-05-18 15:50:48 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-05-18 17:55:29 +0200
commit7c647bcaeba7a08955eb3a66a42cf673404731df (patch)
treeabe1f7bc4f021376102b50453a7085474306ac00 /hugolib
parent95818e27dc9276c33b853f16137de356606d9f9f (diff)
Allow empty params.mainSections
Updates #10953
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/config_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/hugolib/config_test.go b/hugolib/config_test.go
index 1baaf7196..994734ce6 100644
--- a/hugolib/config_test.go
+++ b/hugolib/config_test.go
@@ -871,3 +871,29 @@ Param: svParamValue
`)
}
+
+func TestConfigEmptyMainSections(t *testing.T) {
+ t.Parallel()
+
+ files := `
+-- hugo.yml --
+params:
+ mainSections:
+-- content/mysection/_index.md --
+-- content/mysection/mycontent.md --
+-- layouts/index.html --
+mainSections: {{ site.Params.mainSections }}
+
+`
+ b := NewIntegrationTestBuilder(
+ IntegrationTestConfig{
+ T: t,
+ TxtarString: files,
+ },
+ ).Build()
+
+ b.AssertFileContent("public/index.html", `
+mainSections: []
+`)
+
+}