hugolib: Must recreate Paginator on live-reload

The structure may potentially have changed, and then it fails.

Fixes #3315
This commit is contained in:
Bjørn Erik Pedersen
2017-04-12 18:11:37 +02:00
parent e765b43e2b
commit 45c7452668
2 changed files with 18 additions and 12 deletions

View File

@@ -75,14 +75,10 @@ func pageRenderer(s *Site, pages <-chan *Page, results chan<- error, wg *sync.Wa
)
if i == 0 {
page.pageOutputInit.Do(func() {
var po *PageOutput
po, err = newPageOutput(page, false, outFormat)
page.mainPageOutput = po
})
pageOutput = page.mainPageOutput
pageOutput, err = newPageOutput(page, false, outFormat)
page.mainPageOutput = pageOutput
} else {
pageOutput, err = newPageOutput(page, true, outFormat)
pageOutput, err = page.mainPageOutput.copyWithFormat(outFormat)
}
if err != nil {
@@ -159,7 +155,10 @@ func (s *Site) renderPaginator(p *PageOutput) error {
continue
}
pagerNode := p.copy()
pagerNode, err := p.copy()
if err != nil {
return err
}
pagerNode.paginator = pager
if pager.TotalPages() > 0 {