From a89fb86cdf453c4bf8e9d0c1ff2f025006c0ab34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 7 Feb 2017 10:43:30 +0700 Subject: [PATCH] tpl: Must do a extra lookup of cloned base templates See #2549 Fixes #3013 --- tpl/template.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tpl/template.go b/tpl/template.go index 1c71989f4..9efb8869a 100644 --- a/tpl/template.go +++ b/tpl/template.go @@ -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 }