summaryrefslogtreecommitdiffstats
path: root/hugolib/hugo_sites.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-11-06 10:04:37 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-11-06 11:04:10 +0100
commitb8b8436fcca17c152e94cae2a1acad32efc3946c (patch)
tree4ee55f6a733fe4edd5e96ee756acb4056dd9fb19 /hugolib/hugo_sites.go
parent42d8dfc8c88af03ea926a59bc2332acc70cca5f6 (diff)
hugolib: Fix changing paginators in lazy render
Fixes #5406
Diffstat (limited to 'hugolib/hugo_sites.go')
-rw-r--r--hugolib/hugo_sites.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/hugolib/hugo_sites.go b/hugolib/hugo_sites.go
index 65e3260f6..9cc091927 100644
--- a/hugolib/hugo_sites.go
+++ b/hugolib/hugo_sites.go
@@ -416,6 +416,7 @@ type BuildCfg struct {
// a Page: If it is recently visited (the home pages will always be in this set) or changed.
// Note that a page does not have to have a content page / file.
// For regular builds, this will allways return true.
+// TODO(bep) rename/work this.
func (cfg *BuildCfg) shouldRender(p *Page) bool {
if p.forceRender {
p.forceRender = false
@@ -427,6 +428,9 @@ func (cfg *BuildCfg) shouldRender(p *Page) bool {
}
if cfg.RecentlyVisited[p.RelPermalink()] {
+ if cfg.PartialReRender {
+ _ = p.initMainOutputFormat()
+ }
return true
}
@@ -644,15 +648,13 @@ func (h *HugoSites) setupTranslations() {
func (s *Site) preparePagesForRender(start bool) error {
for _, p := range s.Pages {
- p.setContentInit(start)
- if err := p.initMainOutputFormat(); err != nil {
+ if err := p.prepareForRender(start); err != nil {
return err
}
}
for _, p := range s.headlessPages {
- p.setContentInit(start)
- if err := p.initMainOutputFormat(); err != nil {
+ if err := p.prepareForRender(start); err != nil {
return err
}
}