lockserver/frontend/frontend.go

37 lines
526 B
Go
Raw Normal View History

package frontend
import (
"embed"
"html/template"
"io/fs"
)
var (
//go:embed static
static embed.FS
Static fs.FS
//go:embed *.html
templatesFS embed.FS
Templates *template.Template
funcs = template.FuncMap{
2024-11-23 03:50:18 +00:00
"version": func() string { return "better-zwave-locks v0.x.x aaaaaaaa" },
}
)
func init() {
t := template.New("").Funcs(funcs)
var err error
Templates, err = t.ParseFS(templatesFS, "*")
if err != nil {
panic(err)
}
Static, err = fs.Sub(static, "static")
if err != nil {
panic(err)
}
}