summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hugolib/content_map_page.go2
-rw-r--r--hugolib/rebuild_test.go23
2 files changed, 24 insertions, 1 deletions
diff --git a/hugolib/content_map_page.go b/hugolib/content_map_page.go
index ae7468b0a..35a2650a1 100644
--- a/hugolib/content_map_page.go
+++ b/hugolib/content_map_page.go
@@ -192,7 +192,7 @@ func (t *pageTrees) collectIdentitiesSurroundingIn(key string, maxSamples int, t
level := strings.Count(prefix, "/")
tree.WalkPrefixRaw(prefix, func(s string, n contentNodeI) bool {
if level != strings.Count(s, "/") {
- return true
+ return false
}
n.ForEeachIdentity(func(id identity.Identity) bool {
ids = append(ids, id)
diff --git a/hugolib/rebuild_test.go b/hugolib/rebuild_test.go
index f599d640d..d29215a01 100644
--- a/hugolib/rebuild_test.go
+++ b/hugolib/rebuild_test.go
@@ -261,6 +261,29 @@ func TestRebuilErrorRecovery(t *testing.T) {
b.EditFileReplaceAll("content/mysection/mysectionbundle/index.md", "{{< foo }}", "{{< foo >}}").Build()
}
+func TestRebuildAddPageListPagesInHome(t *testing.T) {
+ files := `
+-- hugo.toml --
+baseURL = "https://example.com"
+disableLiveReload = true
+-- content/asection/s1.md --
+-- content/p1.md --
+---
+title: "P1"
+weight: 1
+---
+-- layouts/_default/single.html --
+Single: {{ .Title }}|{{ .Content }}|
+-- layouts/index.html --
+Pages: {{ range .RegularPages }}{{ .RelPermalink }}|{{ end }}$
+`
+
+ b := TestRunning(t, files)
+ b.AssertFileContent("public/index.html", "Pages: /p1/|$")
+ b.AddFiles("content/p2.md", ``).Build()
+ b.AssertFileContent("public/index.html", "Pages: /p1/|/p2/|$")
+}
+
func TestRebuildScopedToOutputFormat(t *testing.T) {
files := `
-- hugo.toml --