package templates import ( "embed" "io/fs" "net/http" "os" ) //go:embed static var staticFS embed.FS func FS() fs.FS { if os.Getenv("DEBUG") == "1" { return os.DirFS("./templates/static") } f, _ := fs.Sub(staticFS, "static") return f } func HttpFS() http.FileSystem { return http.FS(FS()) }