feat: Add fallback directory to load includes from

This commit is contained in:
Manuel Rüger
2023-10-17 12:53:10 +02:00
parent 8e16f6f29c
commit d269369911
6 changed files with 29 additions and 9 deletions

View File

@@ -106,6 +106,7 @@ func (macro *Macro) configure(node interface{}, groups [][]byte) interface{} {
func ExtractMacros(
base string,
includePath string,
contents []byte,
templates *template.Template,
) ([]Macro, []byte, error) {
@@ -167,7 +168,7 @@ func ExtractMacros(
return nil
}
} else {
macro.Template, err = includes.LoadTemplate(base, template, "{{", "}}", templates)
macro.Template, err = includes.LoadTemplate(base, includePath, template, "{{", "}}", templates)
if err != nil {
err = karma.Format(err, "unable to load template")