From 00298c205881b574ea426774b69c5c701e1e598e Mon Sep 17 00:00:00 2001 From: xing Date: Mon, 19 Sep 2022 12:38:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/templatefs.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/templates/templatefs.go b/templates/templatefs.go index 27391f2..3c680ac 100644 --- a/templates/templatefs.go +++ b/templates/templatefs.go @@ -27,9 +27,7 @@ func (t *FsTemplate) AddTemplate() { } for _, include := range mainTemplates { name := filepath.Base(include) - in := append([]string{include}, "layout/*.gohtml") - //n := strings.Replace(name, ".gohtml", "", -1) - t.Templates[include] = template.Must(template.New(name).Funcs(t.FuncMap).ParseFS(TemplateFs, in...)) + t.Templates[include] = template.Must(template.New(name).Funcs(t.FuncMap).ParseFS(TemplateFs, include, "layout/*.gohtml")) } } @@ -37,7 +35,6 @@ func (t FsTemplate) Instance(name string, data any) render.Render { r := t.Templates[name] return render.HTML{ Template: r, - //Name: name, - Data: data, + Data: data, } }