From 2247546017c00201d2ce1232dd5303295451f1cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 16 Aug 2018 10:58:05 +0200 Subject: [PATCH] hugolib: Force render of any changed page, even in Fast Render Mode Fixes #5083 --- hugolib/hugo_sites.go | 5 +++++ hugolib/page.go | 5 +++++ hugolib/page_bundler.go | 1 + 3 files changed, 11 insertions(+) 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)