tpl/tplimpl: Fix .Site.Params case regression

Fixes #5094
This commit is contained in:
Bjørn Erik Pedersen
2018-08-19 13:30:42 +02:00
parent 834617f9f8
commit fdff0d3af4
2 changed files with 17 additions and 11 deletions

View File

@@ -213,16 +213,6 @@ func (d decl) indexOfReplacementStart(idents []string) int {
// .Data.Params.someKey
return -1
}
if !d.isKeyword(container) {
// where $pages ".Params.toc_hide" "!=" true
return -1
}
}
if i < len(resolvedIdents)-1 {
next := resolvedIdents[i+1]
if !d.isKeyword(next) {
return -1
}
}
paramFound = true
@@ -298,6 +288,11 @@ func (d decl) resolveVariables(idents []string) ([]string, bool) {
return nil, false
}
if !d.isKeyword(replacement) {
// This can not be .Site.Params etc.
return nil, false
}
replacement = strings.TrimPrefix(replacement, ".")
if replacement == "" {