26 lines
721 B
Go
26 lines
721 B
Go
package web
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
"net/http"
|
|
)
|
|
|
|
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -stdlib -writer templates/index.jade
|
|
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -stdlib -writer templates/nospace.jade
|
|
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -stdlib -writer templates/deleted.jade
|
|
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -stdlib -writer templates/uploaded.jade
|
|
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -stdlib -writer templates/error404.jade
|
|
|
|
//go:embed assets
|
|
var assetsDir embed.FS
|
|
|
|
func Assets() http.FileSystem {
|
|
f, _ := fs.Sub(assetsDir, "assets")
|
|
return http.FS(f)
|
|
}
|
|
|
|
func AssetsGetFile(path string) ([]byte, error) {
|
|
return assetsDir.ReadFile("assets/" + path)
|
|
}
|