tpl: Must do a extra lookup of cloned base templates

See #2549
Fixes #3013
This commit is contained in:
Bjørn Erik Pedersen 2017-02-07 10:43:30 +07:00
parent f404603340
commit a89fb86cdf

View file

@ -109,6 +109,10 @@ func (*TemplateProvider) Clone(d *deps.Deps) error {
for k, v := range t.overlays {
vc := template.Must(v.Clone())
// The extra lookup is a workaround, see
// * https://github.com/golang/go/issues/16101
// * https://github.com/spf13/hugo/issues/2549
vc = vc.Lookup(vc.Name())
vc.Funcs(tmpl.funcster.funcMap)
tmpl.overlays[k] = vc
}