hugolib: Force render of any changed page, even in Fast Render Mode - hugo - [fork] hugo port for 9front
(HTM) git clone git@git.drkhsh.at/hugo.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Submodules
(DIR) README
(DIR) LICENSE
---
(DIR) commit 2247546017c00201d2ce1232dd5303295451f1cc
(DIR) parent d139a037d98e4b388687eecb7831758412247c58
(HTM) Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date: Thu, 16 Aug 2018 10:58:05 +0200
hugolib: Force render of any changed page, even in Fast Render Mode
Fixes #5083
Diffstat:
M hugolib/hugo_sites.go | 5 +++++
M hugolib/page.go | 5 +++++
M hugolib/page_bundler.go | 1 +
3 files changed, 11 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/hugolib/hugo_sites.go b/hugolib/hugo_sites.go
@@ -366,6 +366,11 @@ type BuildCfg struct {
// Note that a page does not have to have a content page / file.
// For regular builds, this will allways return true.
func (cfg *BuildCfg) shouldRender(p *Page) bool {
+ if p.forceRender {
+ p.forceRender = false
+ return true
+ }
+
if len(cfg.RecentlyVisited) == 0 {
return true
}
(DIR) diff --git a/hugolib/page.go b/hugolib/page.go
@@ -265,6 +265,11 @@ type Page struct {
lang string
+ // When in Fast Render Mode, we only render a sub set of the pages, i.e. the
+ // pages the user is working on. There are, however, situations where we need to
+ // signal other pages to be rendered.
+ forceRender bool
+
// The output formats this page will be rendered to.
outputFormats output.Formats
(DIR) diff --git a/hugolib/page_bundler.go b/hugolib/page_bundler.go
@@ -110,6 +110,7 @@ func (s *siteContentProcessor) process(ctx context.Context) error {
}
if s.partialBuild {
+ p.forceRender = true
s.site.replacePage(p)
} else {
s.site.addPage(p)