mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Fix regression when config for OutputFormat.BaseName is an empty string
Fixes #11000
This commit is contained in:
@@ -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")
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user