You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
307 B
Go
25 lines
307 B
Go
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())
|
|
}
|