diff options
author | Alexey Grachov <grachov.alexey@gmail.com> | 2018-01-28 12:46:48 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-01-30 10:49:24 +0100 |
commit | 1707dae8d3634006017eb6d040df4dbafc53d92f (patch) | |
tree | f7e99a0be27a48b7d195dffb33613b362f71107b /hugolib/site.go | |
parent | 2fa70c9344b231c9d999bbafdfa4acbf27ed9f6e (diff) |
hugolib: Handle newly created files in Fast Render Mode
Updates #4339
Diffstat (limited to 'hugolib/site.go')
-rw-r--r-- | hugolib/site.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/hugolib/site.go b/hugolib/site.go index ece4e07af..8a3cde9c7 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -536,6 +536,7 @@ func (s *Site) timerStep(step string) { type whatChanged struct { source bool other bool + files map[string]bool } // RegisterMediaTypes will register the Site's media types in the mime @@ -640,6 +641,7 @@ func (s *Site) processPartial(events []fsnotify.Event) (whatChanged, error) { dataChanged = []fsnotify.Event{} i18nChanged = []fsnotify.Event{} shortcodesChanged = make(map[string]bool) + sourceFilesChanged = make(map[string]bool) // prevent spamming the log on changes logger = helpers.NewDistinctFeedbackLogger() @@ -723,7 +725,7 @@ func (s *Site) processPartial(events []fsnotify.Event) (whatChanged, error) { } sourceReallyChanged = append(sourceReallyChanged, ev) - + sourceFilesChanged[ev.Name] = true } for shortcode := range shortcodesChanged { @@ -758,6 +760,7 @@ func (s *Site) processPartial(events []fsnotify.Event) (whatChanged, error) { changed := whatChanged{ source: len(sourceChanged) > 0, other: len(tmplChanged) > 0 || len(i18nChanged) > 0 || len(dataChanged) > 0, + files: sourceFilesChanged, } return changed, nil @@ -938,7 +941,7 @@ func (s *Site) render(config *BuildCfg, outFormatIdx int) (err error) { } - if err = s.renderPages(config.RecentlyVisited); err != nil { + if err = s.renderPages(config.RecentlyVisited, config.whatChanged.files); err != nil { return } @@ -1246,7 +1249,6 @@ func (c *contentCaptureResultHandler) handleCopyFiles(filenames ...string) { } func (s *Site) readAndProcessContent(filenames ...string) error { - ctx := context.Background() g, ctx := errgroup.WithContext(ctx) |