From 99fd8a9cf96a51fcd9e50445cb035cc9ecd012de Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 22 Mar 2025 13:44:03 +0800 Subject: Variable name lengths --- resources.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'resources.go') diff --git a/resources.go b/resources.go index dcfc2a5..18f9849 100644 --- a/resources.go +++ b/resources.go @@ -36,9 +36,12 @@ var resourcesFS embed.FS var templates *template.Template func loadTemplates() (err error) { - m := minify.New() - minifier := html.Minifier{TemplateDelims: [2]string{"{{", "}}"}, KeepDefaultAttrVals: true} //exhaustruct:ignore - m.Add("text/html", &minifier) + minifier := minify.New() + minifierOptions := html.Minifier{ + TemplateDelims: [2]string{"{{", "}}"}, + KeepDefaultAttrVals: true, + } //exhaustruct:ignore + minifier.Add("text/html", &minifierOptions) templates = template.New("templates").Funcs(template.FuncMap{ "first_line": firstLine, @@ -58,7 +61,7 @@ func loadTemplates() (err error) { return err } - minified, err := m.Bytes("text/html", content) + minified, err := minifier.Bytes("text/html", content) if err != nil { return err } -- cgit v1.2.3