summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-02-14 15:16:55 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-02-14 15:16:55 +0100
commit8c840480336de030471fffb09623fbc124809dcb (patch)
tree3dd6a284bbaad076c1de3d4543462ad236aa93fc /commands
parentad176055d9e87c02da4be405210b297036dd2500 (diff)
Force full rebuild when site config changes
Fixes #1840
Diffstat (limited to 'commands')
-rw-r--r--commands/hugo.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/commands/hugo.go b/commands/hugo.go
index f363cc7a0..83dae0d11 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