Added embed, nix, and a makefile

This commit is contained in:
2026-04-28 14:34:20 -06:00
parent 85a2a3116b
commit 73aff92505
5 changed files with 62 additions and 4 deletions
+3 -3
View File
@@ -4,16 +4,16 @@ import (
"context"
"fmt"
"html/template"
"io/fs"
"log"
"net/http"
"path/filepath"
"sprintpadawan/lib"
)
var templates *template.Template
func init() {
func InitTemplates(fsys fs.FS) {
templates = template.Must(template.New("").Funcs(template.FuncMap{
"scaleToOptions": scaleToOptions,
"derefInt": func(i *int) int {
@@ -51,7 +51,7 @@ func init() {
}
return d, nil
},
}).ParseGlob(filepath.Join("templates", "*.html")))
}).ParseFS(fsys, "templates/*.html"))
}
func isHTMX(r *http.Request) bool {