mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
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:
parent
baa62d0abb
commit
3743875778
1 changed files with 2 additions and 0 deletions
|
@ -17,10 +17,12 @@ import (
|
||||||
"html/template"
|
"html/template"
|
||||||
|
|
||||||
"github.com/eknkc/amber"
|
"github.com/eknkc/amber"
|
||||||
|
"github.com/spf13/afero"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (t *templateHandler) compileAmberWithTemplate(b []byte, path string, templ *template.Template) (*template.Template, error) {
|
func (t *templateHandler) compileAmberWithTemplate(b []byte, path string, templ *template.Template) (*template.Template, error) {
|
||||||
c := amber.New()
|
c := amber.New()
|
||||||
|
c.Options.VirtualFilesystem = afero.NewHttpFs(t.layoutsFs)
|
||||||
|
|
||||||
if err := c.ParseData(b, path); err != nil {
|
if err := c.ParseData(b, path); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in a new issue