mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
tpl: Make {{ template "partials/foo.html" . }} work in older setups
Fixes #13599
This commit is contained in:
@@ -99,7 +99,14 @@ func (t *templateNamespace) parseTemplate(ti *TemplInfo) error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Issue #13599.
|
||||
if ti.category == CategoryPartial && ti.Fi != nil && ti.Fi.Meta().PathInfo.Section() == "partials" {
|
||||
aliasName := strings.TrimPrefix(name, "_")
|
||||
if _, err := prototype.AddParseTree(aliasName, templ.(*htmltemplate.Template).Tree); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user