tpl/tplimpl: Fix compiling Amber templates that import other templates

Without this patch, amber would try to load templates from the OS filesystem
instead of the layouts virtual filesystem.
This commit is contained in:
Steven Allen authored and Bjørn Erik Pedersen committed 2018-08-17 10:04:07 +02:00
1 parent baa62d0abb
commit 3743875778
1 file changed
+2
+2
View File
@@ -17,10 +17,12 @@ import (
"html/template"
"github.com/eknkc/amber"
"github.com/spf13/afero"
)
func (t *templateHandler) compileAmberWithTemplate(b []byte, path string, templ *template.Template) (*template.Template, error) {
c := amber.New()
c.Options.VirtualFilesystem = afero.NewHttpFs(t.layoutsFs)
if err := c.ParseData(b, path); err != nil {
return nil, err