From 2c24800b783d4b1165f2ff312525b20b84333a9c Mon Sep 17 00:00:00 2001 From: xing Date: Fri, 4 Nov 2022 12:25:00 +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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/templatefs.go b/templates/templatefs.go index 599128a..6024ca2 100644 --- a/templates/templatefs.go +++ b/templates/templatefs.go @@ -2,7 +2,6 @@ package templates import ( "embed" - "fmt" "github.com/gin-gonic/gin/render" "html/template" "io/fs" @@ -31,7 +30,7 @@ func (t *FsTemplate) SetTemplate() *FsTemplate { name := filepath.Base(include) c := strings.Split(include, "/") base := c[0] - t.Templates[include] = template.Must(template.New(name).Funcs(t.FuncMap).ParseFS(TemplateFs, include, fmt.Sprintf("%s/layout/*.gohtml", base))) + t.Templates[include] = template.Must(template.New(name).Funcs(t.FuncMap).ParseFS(TemplateFs, include, filepath.Join(base, "layout/*.gohtml"))) } return t }