aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/disableKinds_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2020-06-16 15:43:50 +0200
committerBjørn Erik Pedersen <[email protected]>2020-06-18 09:09:56 +0200
commitfc045e12a953aac88b942c25b958c5c0554b252b (patch)
treead8e171d0730f55eb9a531c1a9f0a8dfb51065ad /hugolib/disableKinds_test.go
parent9679023f2b0d7c55b70f23fd94603f301a841079 (diff)
downloadhugo-fc045e12a953aac88b942c25b958c5c0554b252b.tar.gz
hugo-fc045e12a953aac88b942c25b958c5c0554b252b.zip
Rename taxonomy kinds from taxonomy to term, taxonomyTerm to taxonomy
And we have taken great measures to limit potential site breakage: * For `disableKinds` and `outputs` we try to map from old to new values if possible, if not we print an ERROR that can be toggled off if not relevant. * The layout lookup is mostly compatible with more options for the new `term` kind. That leaves: * Where queries in site.Pages using taxonomy/taxonomyTerm Kind values as filter. * Other places where these kind value are used in the templates (classes etc.) Fixes #6911 Fixes #7395
Diffstat (limited to 'hugolib/disableKinds_test.go')
-rw-r--r--hugolib/disableKinds_test.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/hugolib/disableKinds_test.go b/hugolib/disableKinds_test.go
index 87c2b5d3d..4f12ee2b5 100644
--- a/hugolib/disableKinds_test.go
+++ b/hugolib/disableKinds_test.go
@@ -28,6 +28,7 @@ func TestDisable(t *testing.T) {
config := fmt.Sprintf(`
baseURL = "http://example.com/blog"
enableRobotsTXT = true
+ignoreErrors = ["error-disable-taxonomy"]
disableKinds = [%q]
`, disableKind)
@@ -141,7 +142,7 @@ title: Headless Local Lists Sub
b.Assert(len(s.Taxonomies()["categories"]), qt.Equals, 0)
})
- disableKind = page.KindTaxonomy
+ disableKind = page.KindTerm
c.Run("Disable "+disableKind, func(c *qt.C) {
b := newSitesBuilder(c, disableKind)
b.Build(BuildCfg{})
@@ -153,7 +154,7 @@ title: Headless Local Lists Sub
b.Assert(getPage(b, "/categories/mycat"), qt.IsNil)
})
- disableKind = page.KindTaxonomyTerm
+ disableKind = page.KindTaxonomy
c.Run("Disable "+disableKind, func(c *qt.C) {
b := newSitesBuilder(c, disableKind)
b.Build(BuildCfg{})
@@ -319,7 +320,7 @@ title: Headless Local Lists Sub
// https://github.com/gohugoio/hugo/issues/6897#issuecomment-587947078
func TestDisableRSSWithRSSInCustomOutputs(t *testing.T) {
b := newTestSitesBuilder(t).WithConfigFile("toml", `
-disableKinds = ["taxonomy", "taxonomyTerm", "RSS"]
+disableKinds = ["term", "taxonomy", "RSS"]
[outputs]
home = [ "HTML", "RSS" ]
`).Build(BuildCfg{})