fix template parse bug
This commit is contained in:
parent
941b1dfbbf
commit
bd3d7bfe23
|
@ -1,2 +1,3 @@
|
|||
shitty-ssg
|
||||
public
|
||||
|
||||
|
|
|
@ -54,16 +54,16 @@ func NewSiteConfig(id SiteID) (*SiteConfig, error) {
|
|||
|
||||
func (sc *SiteConfig) ParseTemplates(tplPath string) error {
|
||||
for _, tplConf := range sc.TemplateConfigs {
|
||||
for _, tName := range tplConf.TemplateNames {
|
||||
var tFiles []string
|
||||
for _, tName := range tplConf.TemplateNames {
|
||||
tFiles = append(tFiles, filepath.Join(tplPath, fmt.Sprintf("%s.%s", tName, tplConf.TemplateExt)))
|
||||
}
|
||||
tpl, err := template.ParseFiles(tFiles...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
tplConf.Template = tpl
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue