From cc5ae1a0a1b1abfb147b74e6583f15a585566cf0 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 05 Apr 2025 23:25:06 +0800 Subject: [PATCH] Move trivial template functions into misc --- http_template_funcs.go => internal/misc/trivial.go | 2 +- resources.go | 10 +++++----- diff --git a/http_template_funcs.go b/internal/misc/trivial.go rename from http_template_funcs.go rename to internal/misc/trivial.go index 11e4fadf5d1911868cdae76e44ba1581214d5585..e59c17e96364c93c4befb9ec33b8ea35d950e4c5 100644 --- a/http_template_funcs.go +++ b/internal/misc/trivial.go @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-only // SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu -package forge +package misc import ( "net/url" diff --git a/resources.go b/resources.go index 637b8edbea751f1f40aaee20a70d686c7dfa5436..e2168a3bf37d4686697cf272c705a6c98bb16409 100644 --- a/resources.go +++ b/resources.go @@ -32,11 +32,11 @@ } //exhaustruct:ignore minifier.Add("text/html", &minifierOptions) templates = template.New("templates").Funcs(template.FuncMap{ - "first_line": FirstLine, - "path_escape": PathEscape, - "query_escape": QueryEscape, - "dereference_error": DereferenceOrZero[error], - "minus": Minus, + "first_line": misc.FirstLine, + "path_escape": misc.PathEscape, + "query_escape": misc.QueryEscape, + "dereference_error": misc.DereferenceOrZero[error], + "minus": misc.Minus, }) err = fs.WalkDir(embeddedResourcesFS, "templates", func(path string, d fs.DirEntry, err error) error { -- 2.48.1