From: Bjørn Erik Pedersen Date: Sun, 14 Feb 2016 14:16:55 +0000 (+0100) Subject: Force full rebuild when site config changes X-Git-Tag: v0.16~325 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8c840480336de030471fffb09623fbc124809dcb;p=brevno-suite%2Fhugo Force full rebuild when site config changes Fixes #1840 --- diff --git a/commands/hugo.go b/commands/hugo.go index f363cc7a..83dae0d1 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -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