Skip to content

Commit

Permalink
hugolib: Make sure that empty terms lists are still created
Browse files Browse the repository at this point in the history
Fixes #2977
  • Loading branch information
bep committed Mar 1, 2017
1 parent 3669015 commit 9671162
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 7 additions & 7 deletions hugolib/hugo_sites.go
Expand Up @@ -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)
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions hugolib/taxonomy_test.go
Expand Up @@ -73,6 +73,7 @@ defaultContentLanguage = "en"
tag = "tags"
category = "categories"
other = "others"
empty = "empties"
`

pageTemplate := `---
Expand Down Expand Up @@ -141,4 +142,7 @@ others:
require.Equal(t, "Hello Hugo World", helloWorld.Title)
}

// Issue #2977
th.assertFileContent("public/empties/index.html", "Terms List", "Empties")

}

0 comments on commit 9671162

Please sign in to comment.