hugolib: Make sure that empty terms lists are still created
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 1 Mar 2017 16:07:38 +0000 (17:07 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 1 Mar 2017 16:07:38 +0000 (17:07 +0100)
Fixes #2977

hugolib/hugo_sites.go
hugolib/taxonomy_test.go

index 1a7bdf901dbdf08b818708ff2f86625ff02bd325..f35c7ce063f5b7464998034f9e3895f3df7e4f85 100644 (file)
@@ -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)
                                        }
                                }
                        }
index 3c6dc2707b0e4a696a8e174462d8e05b72284f17..5687cc032df39ac9b1768a17872e6d11d68de3fd 100644 (file)
@@ -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")
+
 }