diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-05-30 11:38:29 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-05-30 15:59:43 +0200 |
commit | a7d6b1413f7dd7fdda30b12d577b90f4bb0487ff (patch) | |
tree | 7f4d1a5017729f9f9e090ba07eccca043254f11a /hugolib | |
parent | 3f497d496fcb002e18cd339c5850a300346b2f35 (diff) |
Don't panic on empty yaml config params
Fixes #11047
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/config_test.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/hugolib/config_test.go b/hugolib/config_test.go index a8e3b8f2c..edb6b793e 100644 --- a/hugolib/config_test.go +++ b/hugolib/config_test.go @@ -1066,3 +1066,26 @@ LanguageCode: {{ .Site.LanguageCode }}|{{ site.Language.LanguageCode }}| b.AssertFileContent("public/index.html", "LanguageCode: en-US|en-US|") } + +// Issue 11047 +func TestConfigYamlNil(t *testing.T) { + t.Parallel() + + files := ` +-- hugo.yaml -- +params: +-- layouts/index.html -- +Foo: {{ site.Params.foo }}| + + +` + b := NewIntegrationTestBuilder( + IntegrationTestConfig{ + T: t, + TxtarString: files, + }, + ).Build() + + b.AssertFileContent("public/index.html", "Foo: |") + +} |