summaryrefslogtreecommitdiffstats
path: root/hugolib/taxonomy_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-04-15 09:38:14 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-04-15 13:36:05 +0200
commitb799b12f4a693dfeae8a5a362f131081a727bb8f (patch)
treecec0b90c41aea0f091ac5aa8dc72fc7380f78253 /hugolib/taxonomy_test.go
parent701486728e21bc0c6c78c2a8edb988abdf6116c7 (diff)
hugolib: Fix panic for unused taxonomy content files
In Hugo 0.55 we connected the taxonomy nodes with their owning Page. This failed if you had, say, a content file for a author that did not author anything in the site: ``` content/authors/silent-persin/_index.md ``` Fixes #5847
Diffstat (limited to 'hugolib/taxonomy_test.go')
-rw-r--r--hugolib/taxonomy_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/hugolib/taxonomy_test.go b/hugolib/taxonomy_test.go
index 2501ed2e4..f4902ae8d 100644
--- a/hugolib/taxonomy_test.go
+++ b/hugolib/taxonomy_test.go
@@ -117,6 +117,9 @@ permalinkeds:
writeNewContentFile(t, fs.Source, "Category Terms", "2017-01-01", "content/categories/_index.md", 10)
writeNewContentFile(t, fs.Source, "Tag1 List", "2017-01-01", "content/tags/Tag1/_index.md", 10)
+ // https://github.com/gohugoio/hugo/issues/5847
+ writeNewContentFile(t, fs.Source, "Unused Tag List", "2018-01-01", "content/tags/not-used/_index.md", 10)
+
err := h.Build(BuildCfg{})
require.NoError(t, err)
@@ -159,7 +162,7 @@ permalinkeds:
// Make sure that each page.KindTaxonomyTerm page has an appropriate number
// of page.KindTaxonomy pages in its Pages slice.
taxonomyTermPageCounts := map[string]int{
- "tags": 2,
+ "tags": 3,
"categories": 2,
"others": 2,
"empties": 0,