summaryrefslogtreecommitdiffstats
path: root/hugolib/hugo_sites_rebuild_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-04-17 10:36:36 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-04-17 12:56:46 +0200
commit9b17cbb62a056ea7e26b1146cbf3ba42f5acf805 (patch)
tree28c79605fd536905bc365158993b2b2374045698 /hugolib/hugo_sites_rebuild_test.go
parent2957795f5276cc9bc8d438da2d7d9b61defea225 (diff)
hugolib: Fix Pages reinitialization on rebuilds
Which had some unpredictable behaviour when using `.Pages` on home page etc. that had a content page. Fixes #5833
Diffstat (limited to 'hugolib/hugo_sites_rebuild_test.go')
-rw-r--r--hugolib/hugo_sites_rebuild_test.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/hugolib/hugo_sites_rebuild_test.go b/hugolib/hugo_sites_rebuild_test.go
index c2acbc238..4a81fe950 100644
--- a/hugolib/hugo_sites_rebuild_test.go
+++ b/hugolib/hugo_sites_rebuild_test.go
@@ -52,13 +52,16 @@ Content.
b.WithTemplatesAdded("index.html", `
{{ range (.Paginate .Site.RegularPages).Pages }}
-* Page: {{ .Title }}|Summary: {{ .Summary }}|Content: {{ .Content }}
+* Page Paginate: {{ .Title }}|Summary: {{ .Summary }}|Content: {{ .Content }}
+{{ end }}
+{{ range .Pages }}
+* Page Pages: {{ .Title }}|Summary: {{ .Summary }}|Content: {{ .Content }}
{{ end }}
`)
b.Running().Build(BuildCfg{})
- b.AssertFileContent("public/index.html", "* Page: Page 1|Summary: Initial summary|Content: <p>Content.</p>")
+ b.AssertFileContent("public/index.html", "* Page Paginate: Page 1|Summary: Initial summary|Content: <p>Content.</p>")
b.EditFiles(contentFilename, `
---
@@ -72,6 +75,9 @@ Edited content.
b.Build(BuildCfg{})
- b.AssertFileContent("public/index.html", "* Page: Page 1 edit|Summary: Edited summary|Content: <p>Edited content.</p>")
+ b.AssertFileContent("public/index.html", "* Page Paginate: Page 1 edit|Summary: Edited summary|Content: <p>Edited content.</p>")
+
+ // https://github.com/gohugoio/hugo/issues/5833
+ b.AssertFileContent("public/index.html", "* Page Pages: Page 1 edit|Summary: Edited summary|Content: <p>Edited content.</p>")
}