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>2017-02-10 13:26:28 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-02-10 14:57:38 +0300
commit2618cfbeaa06bd2a4d26b3e3999e3c9ca9a49854 (patch)
tree40715bf14911177c527225398cb02b6a849f3788 /tpl/template.go
parent25bfa7e12fcd044368e9983481dfd4bfc8558a55 (diff)
hugolib: Fix error for non-renderable HTML content with shortcodes
This commit re-introduces template lookup order that was accidently removed as part of the template nonglobal refactoring. Fixes #3021
Diffstat (limited to 'tpl/template.go')
-rw-r--r--tpl/template.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/tpl/template.go b/tpl/template.go
index 9efb8869a..844608014 100644
--- a/tpl/template.go
+++ b/tpl/template.go
@@ -141,7 +141,6 @@ func (t *GoHTMLTemplate) initFuncs(d *deps.Deps) {
// Hacky, but we need to make sure that the func names are in the global map.
amber.FuncMap[k] = func() string {
panic("should never be invoked")
- return ""
}
}
@@ -197,12 +196,18 @@ func (t *GoHTMLTemplate) ExecuteTemplateToHTML(context interface{}, layouts ...s
func (t *GoHTMLTemplate) Lookup(name string) *template.Template {
+ if templ := t.Template.Lookup(name); templ != nil {
+ return templ
+ }
+
if t.overlays != nil {
if templ, ok := t.overlays[name]; ok {
return templ
}
}
+ // The clone is used for the non-renderable HTML pages (p.IsRenderable == false) that is parsed
+ // as Go templates late in the build process.
if t.clone != nil {
if templ := t.clone.Lookup(name); templ != nil {
return templ