summaryrefslogtreecommitdiffstats
path: root/tpl/tplimpl/templateProvider.go
diff options
context:
space:
mode:
Diffstat (limited to 'tpl/tplimpl/templateProvider.go')
-rw-r--r--tpl/tplimpl/templateProvider.go27
1 files changed, 6 insertions, 21 deletions
diff --git a/tpl/tplimpl/templateProvider.go b/tpl/tplimpl/templateProvider.go
index 68de00561..933ee7dc3 100644
--- a/tpl/tplimpl/templateProvider.go
+++ b/tpl/tplimpl/templateProvider.go
@@ -25,32 +25,17 @@ var DefaultTemplateProvider *TemplateProvider
// Update updates the Hugo Template System in the provided Deps
// with all the additional features, templates & functions.
-func (*TemplateProvider) Update(deps *deps.Deps) error {
- newTmpl := newTemplateAdapter(deps)
- deps.Tmpl = newTmpl
- deps.TextTmpl = newTmpl.wrapTextTemplate(newTmpl.text.standalone)
- // These needs to be there at parse time.
- newTmpl.initTemplateExecuter()
-
- if err := newTmpl.loadEmbedded(); err != nil {
+func (*TemplateProvider) Update(d *deps.Deps) error {
+ tmpl, err := newTemplateExec(d)
+ if err != nil {
return err
}
-
- if deps.WithTemplate != nil {
- err := deps.WithTemplate(newTmpl)
- if err != nil {
- return err
- }
-
- }
-
- return newTmpl.markReady()
-
+ return tmpl.postTransform()
}
// Clone clones.
func (*TemplateProvider) Clone(d *deps.Deps) error {
- t := d.Tmpl.(*templateHandler)
- t.clone(d)
+ t := d.Tmpl().(*templateExec)
+ d.SetTmpl(t.Clone(d))
return nil
}