Disable LiveReload when Hugo is not running as a server

This change fixes #1410.
This commit is contained in:
Kato Kazuyoshi 2015-10-14 23:27:57 -07:00 committed by spf13
parent ef4dfcec6c
commit 698019a552

View file

@ -1449,7 +1449,7 @@ func (s *Site) renderAndWritePage(name string, dest string, d interface{}, layou
transformLinks = append(transformLinks, transform.AbsURL)
}
if viper.GetBool("watch") && !viper.GetBool("DisableLiveReload") {
if s.Running() && viper.GetBool("watch") && !viper.GetBool("DisableLiveReload") {
transformLinks = append(transformLinks, transform.LiveReloadInject)
}