Fix regression when config for OutputFormat.BaseName is an empty string

Fixes #11000
This commit is contained in:
Bjørn Erik Pedersen
2023-05-23 17:39:49 +02:00
parent d666edad71
commit ed906a86e2
2 changed files with 44 additions and 9 deletions

View File

@@ -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")
}