shithub: hugo

Download patch

ref: a89fb86cdf453c4bf8e9d0c1ff2f025006c0ab34
parent: f404603340067533ef27d2c3bd1806335812001a
author: Bjørn Erik Pedersen <[email protected]>
date: Tue Feb 7 05:43:30 EST 2017

tpl: Must do a extra lookup of cloned base templates

See #2549
Fixes #3013

--- a/tpl/template.go
+++ b/tpl/template.go
@@ -109,6 +109,10 @@
 
 	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
 	}