diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-07-19 19:10:34 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-07-19 19:59:17 +0200 |
commit | d70b6c7d01893cb0db900e98d979483300f005ee (patch) | |
tree | 3d42d8f1a9bd0fde208b8f54594eb05b95b64c27 /hugolib/config_test.go | |
parent | d947db3713ee492f88db440f4c57bdfae7da5bf7 (diff) |
Fix broken handling of legacy taxonomyTerm in disableKinds
Fixes #11257
Diffstat (limited to 'hugolib/config_test.go')
-rw-r--r-- | hugolib/config_test.go | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/hugolib/config_test.go b/hugolib/config_test.go index 9720522ad..ff7b01a3f 100644 --- a/hugolib/config_test.go +++ b/hugolib/config_test.go @@ -1060,7 +1060,7 @@ func TestConfigLegacyValues(t *testing.T) { files := ` -- hugo.toml -- -# taxonomyTerm was renamed to term in Hugo 0.60.0. +# taxonomyTerm was renamed to taxonomy in Hugo 0.60.0. disableKinds = ["taxonomyTerm"] -- layouts/index.html -- @@ -1081,7 +1081,7 @@ Home `) conf := b.H.Configs.Base - b.Assert(conf.IsKindEnabled("term"), qt.Equals, false) + b.Assert(conf.IsKindEnabled("taxonomy"), qt.Equals, false) } // Issue #11000 @@ -1534,3 +1534,39 @@ disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "sect }) } + +// Issue #11257 +func TestDisableKindsTaxonomyTerm(t *testing.T) { + t.Parallel() + + files := ` +-- hugo.toml -- +baseURL = "https://example.com" +disableKinds = ['taxonomyTerm'] +[taxonomies] +category = 'categories' +-- content/p1.md -- +--- +title: "P1" +categories: ["c1"] +--- +-- layouts/index.html -- +Home. +-- layouts/_default/list.html -- +List. + + + +` + b := NewIntegrationTestBuilder( + IntegrationTestConfig{ + T: t, + TxtarString: files, + }, + ).Build() + + b.AssertDestinationExists("index.html", true) + b.AssertDestinationExists("categories/c1/index.html", true) + b.AssertDestinationExists("categories/index.html", false) + +} |