mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05: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":
|
||||
templateName := strings.TrimSuffix(name, filepath.Ext(name)) + ".html"
|
||||
compiler := amber.New()
|
||||
// Parse the input file
|
||||
if err := compiler.ParseFile(path); err != nil {
|
||||
b, err := afero.ReadFile(hugofs.Source(), path)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Parse the input data
|
||||
if err := compiler.ParseData(b, path); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue