summaryrefslogtreecommitdiffstats
path: root/tpl
diff options
context:
space:
mode:
authorSteven Allen <steven@stebalien.com>2018-08-17 08:04:07 +0000
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-08-17 10:04:07 +0200
commit37438757788d279c839506d54f460b2ab37db164 (patch)
tree0016d75cecb783773a32d1208eda3b8947c99eb5 /tpl
parentbaa62d0abbbf24a17d0aa800a4bb217f026c49ad (diff)
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 (limited to 'tpl')
-rw-r--r--tpl/tplimpl/amber_compiler.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/tpl/tplimpl/amber_compiler.go b/tpl/tplimpl/amber_compiler.go
index 10ed0443c..b37becb3d 100644
--- 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