projects
/
brevno-suite
/
hugo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
baa62d0
)
tpl/tplimpl: Fix compiling Amber templates that import other templates
author
Steven Allen
<steven@stebalien.com>
Fri, 17 Aug 2018 08:04:07 +0000
(08:04 +0000)
committer
Bjørn Erik Pedersen
<bjorn.erik.pedersen@gmail.com>
Fri, 17 Aug 2018 08:04:07 +0000
(10:04 +0200)
Without this patch, amber would try to load templates from the OS filesystem
instead of the layouts virtual filesystem.
tpl/tplimpl/amber_compiler.go
patch
|
blob
|
history
diff --git
a/tpl/tplimpl/amber_compiler.go
b/tpl/tplimpl/amber_compiler.go
index 10ed0443c21e9b72ed461c567340b90b8007c893..b37becb3d12486a7c870599adbb4f07d07e764a6 100644
(file)
--- 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