shithub: hugo

Download patch

ref: 7201042946dde78d5ea4fea9cb006fb4dded55c1
parent: 5383fe458c0ce24e1623dd91e795d4fb5772ae9d
author: Iskander (Alex) Sharipov <[email protected]>
date: Fri Feb 1 22:26:05 EST 2019

tpl: Fix strings.HasPrefix args order


--- a/tpl/partials/partials.go
+++ b/tpl/partials/partials.go
@@ -65,7 +65,7 @@
 // Include executes the named partial and returns either a string,
 // when the partial is a text/template, or template.HTML when html/template.
 func (ns *Namespace) Include(name string, contextList ...interface{}) (interface{}, error) {
-	if strings.HasPrefix("partials/", name) {
+	if strings.HasPrefix(name, "partials/") {
 		name = name[8:]
 	}
 	var context interface{}
--- a/tpl/tplimpl/templateFuncster.go
+++ b/tpl/tplimpl/templateFuncster.go
@@ -39,7 +39,7 @@
 // Partial executes the named partial and returns either a string,
 // when called from text/template, for or a template.HTML.
 func (t *templateFuncster) partial(name string, contextList ...interface{}) (interface{}, error) {
-	if strings.HasPrefix("partials/", name) {
+	if strings.HasPrefix(name, "partials/") {
 		name = name[8:]
 	}
 	var context interface{}