mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
fixed #656. Templates work properly when watching.
This commit is contained in:
parent
4a2f16f91e
commit
cdbc741cb8
2 changed files with 7 additions and 1 deletions
|
@ -167,7 +167,7 @@ func (s *Site) Analyze() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Site) prepTemplates() {
|
func (s *Site) prepTemplates() {
|
||||||
s.Tmpl = tpl.T()
|
s.Tmpl = tpl.InitializeT()
|
||||||
s.Tmpl.LoadTemplates(s.absLayoutDir())
|
s.Tmpl.LoadTemplates(s.absLayoutDir())
|
||||||
if s.hasTheme() {
|
if s.hasTheme() {
|
||||||
s.Tmpl.LoadTemplatesWithPrefix(s.absThemeDir()+"/layouts", "theme")
|
s.Tmpl.LoadTemplatesWithPrefix(s.absThemeDir()+"/layouts", "theme")
|
||||||
|
|
|
@ -66,6 +66,12 @@ func T() Template {
|
||||||
return tmpl
|
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
|
// Return a new Hugo Template System
|
||||||
// With all the additional features, templates & functions
|
// With all the additional features, templates & functions
|
||||||
func New() Template {
|
func New() Template {
|
||||||
|
|
Loading…
Reference in a new issue