diff options
author | Bjørn Erik Pedersen <[email protected]> | 2018-01-30 10:33:57 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2018-01-30 10:49:24 +0100 |
commit | 94e736c5e167a0ee70a528e1c19d64a47e7929c2 (patch) | |
tree | d135d857d77d454de45428e8aafb62b288882111 /hugolib/site_render.go | |
parent | 1707dae8d3634006017eb6d040df4dbafc53d92f (diff) | |
download | hugo-94e736c5e167a0ee70a528e1c19d64a47e7929c2.tar.gz hugo-94e736c5e167a0ee70a528e1c19d64a47e7929c2.zip |
hugolib: Extract the Fast Render Mode logic into a method
This also improves on the previous commit as it takes pages without content files into account.
Closes #4339
Diffstat (limited to 'hugolib/site_render.go')
-rw-r--r-- | hugolib/site_render.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/hugolib/site_render.go b/hugolib/site_render.go index eebaec4fa..a2031e0c0 100644 --- a/hugolib/site_render.go +++ b/hugolib/site_render.go @@ -24,7 +24,7 @@ import ( // renderPages renders pages each corresponding to a markdown file. // TODO(bep np doc -func (s *Site) renderPages(filter map[string]bool, files map[string]bool) error { +func (s *Site) renderPages(cfg *BuildCfg) error { results := make(chan error) pages := make(chan *Page) @@ -47,13 +47,10 @@ func (s *Site) renderPages(filter map[string]bool, files map[string]bool) error } - hasFilter := filter != nil && len(filter) > 0 - for _, page := range s.Pages { - if hasFilter && !filter[page.RelPermalink()] && !files[page.Source.Filename()] { - continue + if cfg.shouldRender(page) { + pages <- page } - pages <- page } close(pages) |