summaryrefslogtreecommitdiffstats
path: root/hugolib/node_as_page_test.go
diff options
context:
space:
mode:
authorAnton Staaf <anton@socialhacker.com>2017-03-03 16:00:11 -0800
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-03-04 21:37:52 +0100
commit22c89dcb6c850d1c7645b0daa392e0ce284e3513 (patch)
tree90f7783d8e8efcaead0599ca342b1c787ea8bd46 /hugolib/node_as_page_test.go
parentd0e2a1fa14f95d277aa01bfc635d9270ecd43c46 (diff)
hugolib: Fix HugoSites.createMissingPages
Previously it would only check for existing KindTaxonomyTerm pages if the taxonomy had any terms defined. So for a taxonomy with no terms but a taxonomy terms page it would generate a second empty terms page.
Diffstat (limited to 'hugolib/node_as_page_test.go')
-rw-r--r--hugolib/node_as_page_test.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/hugolib/node_as_page_test.go b/hugolib/node_as_page_test.go
index 922a0e81e..f063faf9a 100644
--- a/hugolib/node_as_page_test.go
+++ b/hugolib/node_as_page_test.go
@@ -96,14 +96,14 @@ func doTestNodeAsPage(t *testing.T, ugly, preserveTaxonomyNames bool) {
require.Len(t, nodes, 8)
- home := nodes[6] // oldest
+ home := nodes[7] // oldest
require.True(t, home.IsHome())
require.True(t, home.IsNode())
require.False(t, home.IsPage())
require.True(t, home.Path() != "")
- section2 := nodes[4]
+ section2 := nodes[5]
require.Equal(t, "Section2", section2.Title)
pages := sites.findAllPagesByKind(KindPage)
@@ -720,6 +720,14 @@ lastMod : %q
Taxonomy Term Categories **Content!**
`, date.Add(13*24*time.Hour).Format(time.RFC822), date.Add(14*24*time.Hour).Format(time.RFC822)))
+ writeSource(t, fs, filepath.Join("content", "tags", filename), fmt.Sprintf(`---
+title: Taxonomy Term Tags
+date : %q
+lastMod : %q
+---
+Taxonomy Term Tags **Content!**
+`, date.Add(15*24*time.Hour).Format(time.RFC822), date.Add(16*24*time.Hour).Format(time.RFC822)))
+
}
func writeLayoutsForNodeAsPageTests(t *testing.T, fs *hugofs.Fs) {