mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
hugolib: Re-work "fast render" logic in the new flow
Note that this fixes some "live reload" issues recently introduced in non-released code. Closes #5811 See #5784
This commit is contained in:
parent
4494a01b79
commit
d0d661dffd
3 changed files with 9 additions and 7 deletions
|
@ -569,7 +569,6 @@ func (cfg *BuildCfg) shouldRender(p *pageState) bool {
|
|||
return false
|
||||
}
|
||||
if p.forceRender {
|
||||
p.forceRender = false
|
||||
return true
|
||||
}
|
||||
|
||||
|
@ -577,6 +576,10 @@ func (cfg *BuildCfg) shouldRender(p *pageState) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
if cfg.RecentlyVisited[p.RelPermalink()] {
|
||||
return true
|
||||
}
|
||||
|
||||
if cfg.whatChanged != nil && !p.File().IsZero() {
|
||||
return cfg.whatChanged.files[p.File().Filename()]
|
||||
}
|
||||
|
|
|
@ -288,10 +288,8 @@ func (h *HugoSites) render(config *BuildCfg) error {
|
|||
// needs this set.
|
||||
s2.rc = &siteRenderingContext{Format: renderFormat}
|
||||
|
||||
if !config.PartialReRender {
|
||||
if err := s2.preparePagesForRender(siteRenderContext.sitesOutIdx); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s2.preparePagesForRender(siteRenderContext.sitesOutIdx); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -110,8 +110,9 @@ func (s *siteContentProcessor) process(ctx context.Context) error {
|
|||
panic(fmt.Sprintf("invalid page site: %v vs %v", p.s, s))
|
||||
}
|
||||
|
||||
if s.partialBuild {
|
||||
p.forceRender = true
|
||||
p.forceRender = s.partialBuild
|
||||
|
||||
if p.forceRender {
|
||||
s.site.replacePage(p)
|
||||
} else {
|
||||
s.site.addPage(p)
|
||||
|
|
Loading…
Reference in a new issue