mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
tpl: Fix strings.HasPrefix args order
This commit is contained in:
parent
5383fe458c
commit
7201042946
2 changed files with 2 additions and 2 deletions
|
@ -65,7 +65,7 @@ type Namespace struct {
|
||||||
// Include executes the named partial and returns either a string,
|
// Include executes the named partial and returns either a string,
|
||||||
// when the partial is a text/template, or template.HTML when html/template.
|
// when the partial is a text/template, or template.HTML when html/template.
|
||||||
func (ns *Namespace) Include(name string, contextList ...interface{}) (interface{}, error) {
|
func (ns *Namespace) Include(name string, contextList ...interface{}) (interface{}, error) {
|
||||||
if strings.HasPrefix("partials/", name) {
|
if strings.HasPrefix(name, "partials/") {
|
||||||
name = name[8:]
|
name = name[8:]
|
||||||
}
|
}
|
||||||
var context interface{}
|
var context interface{}
|
||||||
|
|
|
@ -39,7 +39,7 @@ func newTemplateFuncster(deps *deps.Deps) *templateFuncster {
|
||||||
// Partial executes the named partial and returns either a string,
|
// Partial executes the named partial and returns either a string,
|
||||||
// when called from text/template, for or a template.HTML.
|
// when called from text/template, for or a template.HTML.
|
||||||
func (t *templateFuncster) partial(name string, contextList ...interface{}) (interface{}, error) {
|
func (t *templateFuncster) partial(name string, contextList ...interface{}) (interface{}, error) {
|
||||||
if strings.HasPrefix("partials/", name) {
|
if strings.HasPrefix(name, "partials/") {
|
||||||
name = name[8:]
|
name = name[8:]
|
||||||
}
|
}
|
||||||
var context interface{}
|
var context interface{}
|
||||||
|
|
Loading…
Reference in a new issue