mirror of
https://github.com/gohugoio/hugo.git
synced 2025-03-22 09:41:12 +00:00
Make Amber read from the Afero source file system
This commit is contained in:
parent
0406be3d54
commit
301e4c7e78
1 changed files with 8 additions and 2 deletions
|
@ -306,8 +306,14 @@ func (t *GoHTMLTemplate) AddTemplateFile(name, baseTemplatePath, path string) er
|
||||||
case ".amber":
|
case ".amber":
|
||||||
templateName := strings.TrimSuffix(name, filepath.Ext(name)) + ".html"
|
templateName := strings.TrimSuffix(name, filepath.Ext(name)) + ".html"
|
||||||
compiler := amber.New()
|
compiler := amber.New()
|
||||||
// Parse the input file
|
b, err := afero.ReadFile(hugofs.Source(), path)
|
||||||
if err := compiler.ParseFile(path); err != nil {
|
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse the input data
|
||||||
|
if err := compiler.ParseData(b, path); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue