diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-05-23 17:39:49 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-05-23 19:23:39 +0200 |
commit | ed906a86e2f991adb5c528be6905d188b3f4d2ac (patch) | |
tree | 26cc70564eaa21872006d22ac97eb0c05432c552 /hugolib/config_test.go | |
parent | d666edad71b027e344a255810d1803a054a7bd4d (diff) |
Fix regression when config for OutputFormat.BaseName is an empty string
Fixes #11000
Diffstat (limited to 'hugolib/config_test.go')
-rw-r--r-- | hugolib/config_test.go | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/hugolib/config_test.go b/hugolib/config_test.go index 4af9b7998..2f9c6e3f6 100644 --- a/hugolib/config_test.go +++ b/hugolib/config_test.go @@ -1002,3 +1002,41 @@ Home conf := b.H.Configs.Base b.Assert(conf.IsKindEnabled("term"), qt.Equals, false) } + +// Issue #11000 +func TestConfigEmptyTOMLString(t *testing.T) { + t.Parallel() + + files := ` +-- hugo.toml -- +[mediaTypes] +[mediaTypes."text/htaccess"] +suffixes = ["htaccess"] +[outputFormats] +[outputFormats.htaccess] +mediaType = "text/htaccess" +baseName = "" +isPlainText = false +notAlternative = true +-- content/_index.md -- +--- +outputs: ["html", "htaccess"] +--- +-- layouts/index.html -- +HTML. +-- layouts/_default/list.htaccess -- +HTACCESS. + + + +` + b := NewIntegrationTestBuilder( + IntegrationTestConfig{ + T: t, + TxtarString: files, + }, + ).Build() + + b.AssertFileContent("public/.htaccess", "HTACCESS") + +} |