Add workaround for block template crash

Fixes #2549
This commit is contained in:
Bjørn Erik Pedersen 2016-10-14 11:01:49 +02:00
parent 794589fbfd
commit 588256776e

View file

@ -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