Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-08-16 11:58:05 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-08-16 13:54:59 +0300
commit2247546017c00201d2ce1232dd5303295451f1cc (patch)
tree310cba93da48f854f13e57cb67b7dac59f19a69a /hugolib
parentd139a037d98e4b388687eecb7831758412247c58 (diff)
hugolib: Force render of any changed page, even in Fast Render Mode
Fixes #5083
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/hugo_sites.go5
-rw-r--r--hugolib/page.go5
-rw-r--r--hugolib/page_bundler.go1
3 files changed, 11 insertions, 0 deletions
diff --git a/hugolib/hugo_sites.go b/hugolib/hugo_sites.go
index 9241772b2..11e7bfa4e 100644
--- 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
}
diff --git a/hugolib/page.go b/hugolib/page.go
index c00070c9a..629b90484 100644
--- 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
diff --git a/hugolib/page_bundler.go b/hugolib/page_bundler.go
index 9ebfe1b88..fc135f6b7 100644
--- 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)