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, `
---
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>")
}
page.InternalDependencies
// The children. Regular pages will have none.
- pages page.Pages
- pagesInit sync.Once
+ *pagePages
// Any bundled resources
resources resource.Resources
// Set in fast render mode to force render a given page.
forceRender bool
}
+
+type pagePages struct {
+ pages page.Pages
+ pagesInit sync.Once
+}
RefProvider: page.NopPage,
ShortcodeInfoProvider: page.NopPage,
LanguageProvider: s,
+ pagePages: &pagePages{},
InternalDependencies: s,
init: lazy.New(),
s.init.Reset()
for _, p := range s.rawAllPages {
+ p.pagePages = &pagePages{}
p.subSections = page.Pages{}
p.parent = nil
p.Scratcher = maps.NewScratcher()