mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-01 15:49:11 -05:00
Fix name logic for Amber templates
This commit is contained in:
parent
7f1bcd89b2
commit
e3ea4b48a2
1 changed files with 2 additions and 1 deletions
|
@ -190,13 +190,14 @@ func (t *GoHTMLTemplate) AddTemplateFile(name, baseTemplatePath, path string) er
|
||||||
ext := filepath.Ext(path)
|
ext := filepath.Ext(path)
|
||||||
switch ext {
|
switch ext {
|
||||||
case ".amber":
|
case ".amber":
|
||||||
|
templateName := strings.TrimSuffix(name, filepath.Ext(name)) + ".html"
|
||||||
compiler := amber.New()
|
compiler := amber.New()
|
||||||
// Parse the input file
|
// Parse the input file
|
||||||
if err := compiler.ParseFile(path); err != nil {
|
if err := compiler.ParseFile(path); err != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := compiler.CompileWithTemplate(t.New(name)); err != nil {
|
if _, err := compiler.CompileWithTemplate(t.New(templateName)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
case ".ace":
|
case ".ace":
|
||||||
|
|
Loading…
Reference in a new issue