aboutsummaryrefslogtreecommitdiffstats
path: root/template.go
diff options
context:
space:
mode:
Diffstat (limited to 'template.go')
-rw-r--r--template.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/template.go b/template.go
index 7f4d658..3bdcc9d 100644
--- a/template.go
+++ b/template.go
@@ -92,15 +92,18 @@ func loadTemplates(logger echo.Logger, defaultTheme string, plugins []Plugin) (*
return url.PathEscape(s)
},
})
- for _, p := range plugins {
- base = base.Funcs(p.Filters())
- }
base, err := base.ParseGlob("public/*.html")
if err != nil {
return nil, err
}
+ for _, p := range plugins {
+ if err := p.LoadTemplate(base); err != nil {
+ return nil, fmt.Errorf("failed to load template for plugin '%v': %v", p.Name(), err)
+ }
+ }
+
themes := make(map[string]*template.Template)
files, err := ioutil.ReadDir(themesDir)