2023-01-16 05:24:07 +04:00
|
|
|
package web
|
|
|
|
|
|
|
|
import (
|
|
|
|
"embed"
|
|
|
|
"io/fs"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
|
|
|
// To install a Jade compiler: go install github.com/Joker/jade/cmd/jade@latest
|
2023-02-05 00:55:22 +04:00
|
|
|
//
|
2023-05-22 03:11:12 +04:00
|
|
|
//go:generate $GOPATH/bin/jade -basedir ./templates -pkg=web -writer index.pug stuff.pug mindflow.pug
|
|
|
|
//go:generate $GOPATH/bin/jade -basedir ./templates -pkg=web -writer about.pug guestbook.pug rss.pug
|
|
|
|
//go:generate $GOPATH/bin/jade -basedir ./templates -pkg=web -writer guestbook_admin.pug mindflow_admin.pug
|
2023-06-12 23:05:06 +04:00
|
|
|
//go:generate $GOPATH/bin/jade -basedir ./templates -pkg=web -writer article.pug privacy.pug
|
2023-05-27 20:47:06 +04:00
|
|
|
//go:generate $GOPATH/bin/jade -basedir ./templates -pkg=web -writer errorXXX.pug
|
2023-02-05 05:25:20 +04:00
|
|
|
|
2023-01-16 05:24:07 +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)
|
|
|
|
}
|