aboutsummaryrefslogtreecommitdiff
path: root/resources.go
diff options
context:
space:
mode:
Diffstat (limited to 'resources.go')
-rw-r--r--resources.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/resources.go b/resources.go
index 015f33f..567976d 100644
--- a/resources.go
+++ b/resources.go
@@ -26,6 +26,7 @@ var resourcesFS embed.FS
var templates *template.Template
+// loadTemplates minifies and loads HTML templates.
func loadTemplates() (err error) {
minifier := minify.New()
minifierOptions := html.Minifier{
@@ -36,7 +37,6 @@ func loadTemplates() (err error) {
templates = template.New("templates").Funcs(template.FuncMap{
"first_line": firstLine,
- "base_name": baseName,
"path_escape": pathEscape,
"query_escape": queryEscape,
"dereference_error": dereferenceOrZero[error],
@@ -73,6 +73,8 @@ var (
manHandler http.Handler
)
+// This init sets up static and man handlers. The resulting handlers must be
+// used in the HTTP router, and do nothing unless called from elsewhere.
func init() {
staticFS, err := fs.Sub(resourcesFS, "static")
if err != nil {