ref: cdbc741cb8a9fae3909f9d108fc62e5bacf26657
parent: 4a2f16f91e213b02f008405938fe289c58820e88
author: spf13 <[email protected]>
date: Mon Nov 24 12:10:38 EST 2014
fixed #656. Templates work properly when watching.
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -167,7 +167,7 @@
}
func (s *Site) prepTemplates() {
- s.Tmpl = tpl.T()
+ s.Tmpl = tpl.InitializeT()
s.Tmpl.LoadTemplates(s.absLayoutDir())
if s.hasTheme() {
s.Tmpl.LoadTemplatesWithPrefix(s.absThemeDir()+"/layouts", "theme")
--- a/tpl/template.go
+++ b/tpl/template.go
@@ -66,6 +66,12 @@
return tmpl
}
+// Resets the internal template state to it's initial state
+func InitializeT() Template {
+ tmpl = New()
+ return tmpl
+}
+
// Return a new Hugo Template System
// With all the additional features, templates & functions
func New() Template {