ref: 9671162a22bd1e501fb0a7f033cfad254225dbcb
parent: 3669015f5667f49e6161768c9fd2631c553d5045
author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
date: Wed Mar 1 12:07:38 EST 2017
hugolib: Make sure that empty terms lists are still created Fixes #2977
--- a/hugolib/hugo_sites.go
+++ b/hugolib/hugo_sites.go
@@ -351,14 +351,14 @@
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)
}
}
}
--- a/hugolib/taxonomy_test.go
+++ b/hugolib/taxonomy_test.go
@@ -73,6 +73,7 @@
tag = "tags"
category = "categories"
other = "others"
+empty = "empties"
`
pageTemplate := `---
@@ -140,5 +141,8 @@
require.NotNil(t, helloWorld)
require.Equal(t, "Hello Hugo World", helloWorld.Title)
}
+
+ // Issue #2977
+ th.assertFileContent("public/empties/index.html", "Terms List", "Empties")
}
--
⑨