diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-12-20 08:11:36 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-12-20 11:38:44 +0100 |
commit | 8a58ebb311fd079f65068e7e37725e4d43f17ab5 (patch) | |
tree | b214284b27d2a2cf35ba0689bea688bdd0597e5f /hugolib/hugo_sites.go | |
parent | 0453683816cfbc94e1e19c644f5f84213bb8cf35 (diff) |
hugolib: Improve error and reload handling of hook templates in server mode
Fixes #6635
Diffstat (limited to 'hugolib/hugo_sites.go')
-rw-r--r-- | hugolib/hugo_sites.go | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/hugolib/hugo_sites.go b/hugolib/hugo_sites.go index 526f39fca..8c29e2a88 100644 --- a/hugolib/hugo_sites.go +++ b/hugolib/hugo_sites.go @@ -564,6 +564,9 @@ type BuildCfg struct { // we should skip most of the processing. PartialReRender bool + // Set in server mode when the last build failed for some reason. + ErrRecovery bool + // Recently visited URLs. This is used for partial re-rendering. RecentlyVisited map[string]bool } @@ -807,8 +810,20 @@ func (h *HugoSites) findPagesByKindIn(kind string, inPages page.Pages) page.Page return h.Sites[0].findPagesByKindIn(kind, inPages) } -func (h *HugoSites) resetPageStateFromEvents(idset identity.Identities) { +func (h *HugoSites) resetPageState() { + for _, s := range h.Sites { + for _, p := range s.rawAllPages { + for _, po := range p.pageOutputs { + if po.cp == nil { + continue + } + po.cp.Reset() + } + } + } +} +func (h *HugoSites) resetPageStateFromEvents(idset identity.Identities) { for _, s := range h.Sites { PAGES: for _, p := range s.rawAllPages { @@ -820,7 +835,6 @@ func (h *HugoSites) resetPageStateFromEvents(idset identity.Identities) { for id, _ := range idset { if po.cp.dependencyTracker.Search(id) != nil { po.cp.Reset() - p.forceRender = true continue OUTPUTS } } @@ -834,7 +848,6 @@ func (h *HugoSites) resetPageStateFromEvents(idset identity.Identities) { po.cp.Reset() } } - p.forceRender = true continue PAGES } } |