ref: 8c840480336de030471fffb09623fbc124809dcb
parent: ad176055d9e87c02da4be405210b297036dd2500
author: Bjørn Erik Pedersen <[email protected]>
date: Sun Feb 14 10:16:55 EST 2016
Force full rebuild when site config changes Fixes #1840
--- a/commands/hugo.go
+++ b/commands/hugo.go
@@ -467,6 +467,8 @@
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