Added embed, nix, and a makefile
This commit is contained in:
+3
-3
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user