Fix name logic for Amber templates - hugo - [fork] hugo port for 9front
HTML git clone git@git.drkhsh.at/hugo.git
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
DIR commit e3ea4b48a274770d8a45fe7c1dbbce2340ec4e2d
DIR parent 7f1bcd89b2a977f2e7e61124240fb4c14e8fb5bf
HTML Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date: Sun, 19 Jul 2015 20:12:05 +0200
Fix name logic for Amber templates
Diffstat:
M tpl/template.go | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
DIR diff --git a/tpl/template.go b/tpl/template.go
@@ -190,13 +190,14 @@ func (t *GoHTMLTemplate) AddTemplateFile(name, baseTemplatePath, path string) er
ext := filepath.Ext(path)
switch ext {
case ".amber":
+ templateName := strings.TrimSuffix(name, filepath.Ext(name)) + ".html"
compiler := amber.New()
// Parse the input file
if err := compiler.ParseFile(path); err != nil {
return nil
}
- if _, err := compiler.CompileWithTemplate(t.New(name)); err != nil {
+ if _, err := compiler.CompileWithTemplate(t.New(templateName)); err != nil {
return err
}
case ".ace":