Allow empty params.mainSections

Updates #10953
This commit is contained in:
Bjørn Erik Pedersen
2023-05-18 15:50:48 +02:00
parent 95818e27dc
commit 7c647bcaeb
4 changed files with 35 additions and 1 deletions

View File

@@ -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: []
`)
}