diff --git a/hugolib/page_output.go b/hugolib/page_output.go index 132d755f2..c1550ccd1 100644 --- a/hugolib/page_output.go +++ b/hugolib/page_output.go @@ -141,6 +141,9 @@ func (p *PageOutput) Render(layout ...string) template.HTML { } func (p *Page) Render(layout ...string) template.HTML { + if p.mainPageOutput == nil { + panic(fmt.Sprintf("programming error: no mainPageOutput for %q", p.Path())) + } return p.mainPageOutput.Render(layout...) } diff --git a/hugolib/site.go b/hugolib/site.go index 8ff724d0a..831216779 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -1492,6 +1492,8 @@ func (s *Site) resetBuildState() { s.expiredCount = 0 + spc = newPageCache() + for _, p := range s.rawAllPages { p.subSections = Pages{} p.parent = nil