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
This commit is contained in:
Bjørn Erik Pedersen 2019-04-17 10:36:36 +02:00
parent 2957795f52
commit 9b17cbb62a
4 changed files with 17 additions and 5 deletions

View file

@ -87,8 +87,7 @@ type pageCommon struct {
page.InternalDependencies
// The children. Regular pages will have none.
pages page.Pages
pagesInit sync.Once
*pagePages
// Any bundled resources
resources resource.Resources
@ -111,3 +110,8 @@ type pageCommon struct {
// Set in fast render mode to force render a given page.
forceRender bool
}
type pagePages struct {
pages page.Pages
pagesInit sync.Once
}