commit 37438757788d279c839506d54f460b2ab37db164
parent baa62d0abbbf24a17d0aa800a4bb217f026c49ad
Author: Steven Allen <steven@stebalien.com>
Date: Fri, 17 Aug 2018 08:04:07 +0000
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.
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/tpl/tplimpl/amber_compiler.go b/tpl/tplimpl/amber_compiler.go
@@ -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