2022-05-25 00:27:30 +04:00
|
|
|
package web
|
|
|
|
|
|
|
|
import (
|
|
|
|
"embed"
|
|
|
|
"io/fs"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
2023-05-24 22:28:36 +04:00
|
|
|
//go:generate $GOPATH/bin/jade -pkg=web -writer templates/index.jade
|
|
|
|
//go:generate $GOPATH/bin/jade -pkg=web -writer templates/nospace.jade
|
|
|
|
//go:generate $GOPATH/bin/jade -pkg=web -writer templates/deleted.jade
|
|
|
|
//go:generate $GOPATH/bin/jade -pkg=web -writer templates/uploaded.jade
|
|
|
|
//go:generate $GOPATH/bin/jade -pkg=web -writer templates/error404.jade
|
2022-05-25 00:27:30 +04:00
|
|
|
|
|
|
|
//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)
|
|
|
|
}
|