From b799b12f4a693dfeae8a5a362f131081a727bb8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Mon, 15 Apr 2019 09:38:14 +0200 Subject: 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 --- hugolib/taxonomy_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'hugolib/taxonomy_test.go') 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, -- cgit v1.2.3