Proper integration of live reload with automatic injection

This commit is contained in:
spf13
2014-05-16 17:49:27 -04:00
parent 60ed5bda2b
commit be1ee22032
8 changed files with 224 additions and 121 deletions

View File

@@ -864,6 +864,10 @@ func (s *Site) render(d interface{}, out string, layouts ...string) (err error)
transformLinks = append(transformLinks, absURL...)
}
if viper.GetBool("watch") && !viper.GetBool("DisableLiveReload") {
transformLinks = append(transformLinks, transform.LiveReloadInject)
}
transformer := transform.NewChain(transformLinks...)
var renderBuffer *bytes.Buffer