Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-10-14 12:01:49 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-10-14 12:01:49 +0300
commit588256776ecb4609defacc8b3bafc584b0b045fd (patch)
tree4e8192a63933dfb8692c255434ef1afcfce4ec81 /tpl/template.go
parent794589fbfdb41d380b47685775e7ca28009b420e (diff)
Add workaround for block template crash
Fixes #2549
Diffstat (limited to 'tpl/template.go')
-rw-r--r--tpl/template.go5
1 files changed, 4 insertions, 1 deletions
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