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
|
|
|
//
|
|
|
|
//go:generate $GOPATH/bin/jade -basedir ./templates -pkg=web -stdbuf -stdlib -writer index.pug stuff.pug mindflow.pug about.pug
|
|
|
|
// guestbook.pug
|
|
|
|
//go:generate $GOPATH/bin/jade -basedir ./templates -pkg=web -stdbuf -stdlib -writer rss.pug
|
|
|
|
//go:generate $GOPATH/bin/jade -basedir ./templates -pkg=web -stdbuf -stdlib -writer articles/hardening_mikrotik.pug
|
|
|
|
//go:generate $GOPATH/bin/jade -basedir ./templates -pkg=web -stdbuf -stdlib -writer articles/nginx_recipes_and_tips.pug
|
|
|
|
//go:generate $GOPATH/bin/jade -basedir ./templates -pkg=web -stdbuf -stdlib -writer articles/rpi_root_on_external_drive.pug
|
|
|
|
//go:generate $GOPATH/bin/jade -basedir ./templates -pkg=web -stdbuf -stdlib -writer articles/setting_up_a_mail_server.pug
|
|
|
|
//go:generate $GOPATH/bin/jade -basedir ./templates -pkg=web -stdbuf -stdlib -writer articles/setting_up_a_tor_proxy_relay_hiddenserv.pug
|
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)
|
|
|
|
}
|