Skip to content

Commit

Permalink
hugolib: Force render of any changed page, even in Fast Render Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Aug 16, 2018
1 parent 3bdf0b8 commit eb312c4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hugolib/hugo_sites.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
5 changes: 5 additions & 0 deletions hugolib/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions hugolib/page_bundler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit eb312c4

Please sign in to comment.