mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
tpl: Small Golint fixes
This commit is contained in:
@@ -101,16 +101,16 @@ func New() Template {
|
|||||||
return templates
|
return templates
|
||||||
}
|
}
|
||||||
|
|
||||||
func partial(name string, context_list ...interface{}) template.HTML {
|
func partial(name string, contextList ...interface{}) template.HTML {
|
||||||
if strings.HasPrefix("partials/", name) {
|
if strings.HasPrefix("partials/", name) {
|
||||||
name = name[8:]
|
name = name[8:]
|
||||||
}
|
}
|
||||||
var context interface{}
|
var context interface{}
|
||||||
|
|
||||||
if len(context_list) == 0 {
|
if len(contextList) == 0 {
|
||||||
context = nil
|
context = nil
|
||||||
} else {
|
} else {
|
||||||
context = context_list[0]
|
context = contextList[0]
|
||||||
}
|
}
|
||||||
return ExecuteTemplateToHTML(context, "partials/"+name, "theme/partials/"+name)
|
return ExecuteTemplateToHTML(context, "partials/"+name, "theme/partials/"+name)
|
||||||
}
|
}
|
||||||
@@ -199,9 +199,8 @@ func (t *GoHTMLTemplate) checkState() {
|
|||||||
func (t *GoHTMLTemplate) AddInternalTemplate(prefix, name, tpl string) error {
|
func (t *GoHTMLTemplate) AddInternalTemplate(prefix, name, tpl string) error {
|
||||||
if prefix != "" {
|
if prefix != "" {
|
||||||
return t.AddTemplate("_internal/"+prefix+"/"+name, tpl)
|
return t.AddTemplate("_internal/"+prefix+"/"+name, tpl)
|
||||||
} else {
|
|
||||||
return t.AddTemplate("_internal/"+name, tpl)
|
|
||||||
}
|
}
|
||||||
|
return t.AddTemplate("_internal/"+name, tpl)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *GoHTMLTemplate) AddInternalShortcode(name, content string) error {
|
func (t *GoHTMLTemplate) AddInternalShortcode(name, content string) error {
|
||||||
|
Reference in New Issue
Block a user