Fix name logic for Amber templates

This commit is contained in:
Bjørn Erik Pedersen 2015-07-19 20:12:05 +02:00
parent 7f1bcd89b2
commit e3ea4b48a2

View file

@ -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":