aboutsummaryrefslogtreecommitdiff
path: root/resources.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-22 13:44:03 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-22 13:44:03 +0800
commit99fd8a9cf96a51fcd9e50445cb035cc9ecd012de (patch)
tree077812874d2650216549048524886059391b5d45 /resources.go
parentInitial linting (diff)
downloadforge-99fd8a9cf96a51fcd9e50445cb035cc9ecd012de.tar.gz
forge-99fd8a9cf96a51fcd9e50445cb035cc9ecd012de.tar.zst
forge-99fd8a9cf96a51fcd9e50445cb035cc9ecd012de.zip
Variable name lengths
Diffstat (limited to 'resources.go')
-rw-r--r--resources.go11
1 files changed, 7 insertions, 4 deletions
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
}