From 7c647bcaeba7a08955eb3a66a42cf673404731df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 18 May 2023 15:50:48 +0200 Subject: Allow empty params.mainSections Updates #10953 --- hugolib/config_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'hugolib') 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: [] +`) + +} -- cgit v1.2.3