From 588256776ecb4609defacc8b3bafc584b0b045fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 14 Oct 2016 11:01:49 +0200 Subject: [PATCH] Add workaround for block template crash Fixes #2549 --- tpl/template.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tpl/template.go b/tpl/template.go index 2039548bf..1fba368e4 100644 --- a/tpl/template.go +++ b/tpl/template.go @@ -257,7 +257,10 @@ func (t *GoHTMLTemplate) AddTemplateFileWithMaster(name, overlayFilename, master 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