Skip to content

Commit

Permalink
tpl/tplimpl: Fix compiling Amber templates that import other templates
Browse files Browse the repository at this point in the history
Without this patch, amber would try to load templates from the OS filesystem
instead of the layouts virtual filesystem.
  • Loading branch information
Stebalien authored and bep committed Aug 17, 2018
1 parent baa62d0 commit 3743875
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tpl/tplimpl/amber_compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3743875

Please sign in to comment.