Force full rebuild when site config changes

Fixes #1840
This commit is contained in:
Bjørn Erik Pedersen 2016-02-14 15:16:55 +01:00
parent ad176055d9
commit 8c84048033

View file

@ -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