feat(config): support every path

This commit is contained in:
Anhgelus Morhtuuzh 2025-08-15 21:12:11 +02:00
parent 7b5d816992
commit 91f2ef06c0
Signed by: anhgelus
GPG key ID: 617773CACE89052C
3 changed files with 29 additions and 11 deletions

12
main.go
View file

@ -24,10 +24,10 @@ var (
var (
domain string
configPath string
dev bool = false
dev = false
generateToml bool
generateJson bool
port int = 80
port = 80
)
func init() {
@ -82,11 +82,15 @@ func main() {
var g *golatt.Golatt
if dev {
g = golatt.New(golatt.UsableEmbedFS("templates", templates), os.DirFS("public"), os.DirFS("dist"))
g = golatt.New(
golatt.UsableEmbedFS("templates", templates),
os.DirFS(getPath("public")),
os.DirFS("dist"),
)
} else {
g = golatt.New(
golatt.UsableEmbedFS("templates", templates),
os.DirFS("public"),
os.DirFS(getPath("public")),
golatt.UsableEmbedFS("dist", assets),
)
}