hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit cdbc741cb8a9fae3909f9d108fc62e5bacf26657
parent 4a2f16f91e213b02f008405938fe289c58820e88
Author: spf13 <steve.francia@gmail.com>
Date:   Mon, 24 Nov 2014 17:10:38 -0500

fixed #656. Templates work properly when watching.

Diffstat:
Mhugolib/site.go | 2+-
Mtpl/template.go | 6++++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/hugolib/site.go b/hugolib/site.go
@@ -167,7 +167,7 @@ func (s *Site) Analyze() {
 }
 
 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")
diff --git a/tpl/template.go b/tpl/template.go
@@ -66,6 +66,12 @@ func T() Template {
 	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 {