From ed906a86e2f991adb5c528be6905d188b3f4d2ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 23 May 2023 17:39:49 +0200 Subject: Fix regression when config for OutputFormat.BaseName is an empty string Fixes #11000 --- hugolib/config_test.go | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'hugolib') 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") + +} -- cgit v1.2.3