Skip to content

Commit

Permalink
Force full rebuild when site config changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bep authored and tychoish committed Aug 13, 2017
1 parent 99c2196 commit 9ae7114
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions commands/hugo.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,8 @@ func watchConfig() {
viper.WatchConfig()
viper.OnConfigChange(func(e fsnotify.Event) {
fmt.Println("Config file changed:", e.Name)
// Force a full rebuild
MainSite = nil
utils.CheckErr(buildSite(true))
if !viper.GetBool("DisableLiveReload") {
// Will block forever trying to write to a channel that nobody is reading if livereload isn't initialized
Expand Down

0 comments on commit 9ae7114

Please sign in to comment.