20 lines
305 B
Go
20 lines
305 B
Go
//go:generate go tool templ generate
|
|
package web
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
)
|
|
|
|
//go:embed static/*
|
|
var Static embed.FS
|
|
|
|
func GetStaticFS() fs.FS {
|
|
// fs.Sub returns an fs.FS corresponding to the subtree rooted at "static"
|
|
f, err := fs.Sub(Static, "static")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return f
|
|
}
|