From 9671162a22bd1e501fb0a7f033cfad254225dbcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 1 Mar 2017 17:07:38 +0100 Subject: [PATCH] hugolib: Make sure that empty terms lists are still created Fixes #2977 --- hugolib/hugo_sites.go | 14 +++++++------- hugolib/taxonomy_test.go | 4 ++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/hugolib/hugo_sites.go b/hugolib/hugo_sites.go index 1a7bdf901..f35c7ce06 100644 --- a/hugolib/hugo_sites.go +++ b/hugolib/hugo_sites.go @@ -351,14 +351,14 @@ func (h *HugoSites) createMissingPages() error { newPages = append(newPages, n) } } + } - if s.isEnabled(KindTaxonomyTerm) { - if !foundTaxonomyTermsPage { - foundTaxonomyTermsPage = true - n := s.newTaxonomyTermsPage(plural) - s.Pages = append(s.Pages, n) - newPages = append(newPages, n) - } + if s.isEnabled(KindTaxonomyTerm) { + if !foundTaxonomyTermsPage { + foundTaxonomyTermsPage = true + n := s.newTaxonomyTermsPage(plural) + s.Pages = append(s.Pages, n) + newPages = append(newPages, n) } } } diff --git a/hugolib/taxonomy_test.go b/hugolib/taxonomy_test.go index 3c6dc2707..5687cc032 100644 --- a/hugolib/taxonomy_test.go +++ b/hugolib/taxonomy_test.go @@ -73,6 +73,7 @@ defaultContentLanguage = "en" tag = "tags" category = "categories" other = "others" +empty = "empties" ` pageTemplate := `--- @@ -141,4 +142,7 @@ others: require.Equal(t, "Hello Hugo World", helloWorld.Title) } + // Issue #2977 + th.assertFileContent("public/empties/index.html", "Terms List", "Empties") + }