From bd3d7bfe23bf1da326feb8166c4746942c3795e4 Mon Sep 17 00:00:00 2001 From: Erik Winter Date: Thu, 31 Dec 2020 08:41:51 +0100 Subject: [PATCH] fix template parse bug --- .gitignore | 1 + cmd/ssg/site/config.go | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 2ebff45..dc132a7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ shitty-ssg +public diff --git a/cmd/ssg/site/config.go b/cmd/ssg/site/config.go index 2e43653..9589e20 100644 --- a/cmd/ssg/site/config.go +++ b/cmd/ssg/site/config.go @@ -54,15 +54,15 @@ func NewSiteConfig(id SiteID) (*SiteConfig, error) { func (sc *SiteConfig) ParseTemplates(tplPath string) error { for _, tplConf := range sc.TemplateConfigs { + var tFiles []string for _, tName := range tplConf.TemplateNames { - var tFiles []string 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 } + tpl, err := template.ParseFiles(tFiles...) + if err != nil { + return err + } + tplConf.Template = tpl } return nil