1
0
Fork 0
mirror of https://github.com/gohugoio/hugo.git synced 2025-04-16 22:57:55 +00:00

Force full rebuild when site config changes

Fixes 
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