ref: 588256776ecb4609defacc8b3bafc584b0b045fd
parent: 794589fbfdb41d380b47685775e7ca28009b420e
author: Bjørn Erik Pedersen <[email protected]>
date: Fri Oct 14 07:01:49 EDT 2016
Add workaround for block template crash Fixes #2549
--- a/tpl/template.go
+++ b/tpl/template.go
@@ -257,7 +257,10 @@
if err != nil {
t.errors = append(t.errors, &templateErr{name: name, err: err})
} else {
- t.overlays[name] = overlayTpl
+ // The extra lookup is a workaround, see
+ // * https://github.com/golang/go/issues/16101
+ // * https://github.com/spf13/hugo/issues/2549
+ t.overlays[name] = overlayTpl.Lookup(overlayTpl.Name())
}
return err