shithub: hugo

Download patch

ref: 37438757788d279c839506d54f460b2ab37db164
parent: baa62d0abbbf24a17d0aa800a4bb217f026c49ad
author: Steven Allen <[email protected]>
date: Fri Aug 17 04:04:07 EDT 2018

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.

--- a/tpl/tplimpl/amber_compiler.go
+++ b/tpl/tplimpl/amber_compiler.go
@@ -17,10 +17,12 @@
 	"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