mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
tpl/partials: Remove superflous loop
No need to check the themes template prefix.
This commit is contained in:
@@ -74,7 +74,7 @@ func (ns *Namespace) Include(name string, contextList ...interface{}) (interface
|
|||||||
context = contextList[0]
|
context = contextList[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, n := range []string{"partials/" + name, "theme/partials/" + name} {
|
n := "partials/" + name
|
||||||
templ, found := ns.deps.Tmpl.Lookup(n)
|
templ, found := ns.deps.Tmpl.Lookup(n)
|
||||||
|
|
||||||
if !found {
|
if !found {
|
||||||
@@ -104,7 +104,6 @@ func (ns *Namespace) Include(name string, contextList ...interface{}) (interface
|
|||||||
return template.HTML(s), nil
|
return template.HTML(s), nil
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return "", fmt.Errorf("Partial %q not found", name)
|
return "", fmt.Errorf("Partial %q not found", name)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user