tpl/tplimpl: Fix compiling Amber templates that import other templates - hugo - [fork] hugo port for 9front
(HTM) git clone git@git.drkhsh.at/hugo.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Submodules
(DIR) README
(DIR) LICENSE
---
(DIR) commit 37438757788d279c839506d54f460b2ab37db164
(DIR) parent baa62d0abbbf24a17d0aa800a4bb217f026c49ad
(HTM) 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:
M tpl/tplimpl/amber_compiler.go | 2 ++
1 file changed, 2 insertions(+), 0 deletions(-)
---
(DIR) 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