summaryrefslogtreecommitdiffstats
path: root/hugolib
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-05-23 17:39:49 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-05-23 19:23:39 +0200
commited906a86e2f991adb5c528be6905d188b3f4d2ac (patch)
tree26cc70564eaa21872006d22ac97eb0c05432c552 /hugolib
parentd666edad71b027e344a255810d1803a054a7bd4d (diff)
Fix regression when config for OutputFormat.BaseName is an empty string
Fixes #11000
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/config_test.go38
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")
+
+}