diff options
| author | Anhgelus Morhtuuzh <anhgelus@anhgelus.world> | 2025-02-24 13:53:20 +0100 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <anhgelus@anhgelus.world> | 2025-02-24 13:53:20 +0100 |
| commit | a5fe3b2ea299b5299a46e425803545954d2d26b5 (patch) | |
| tree | 25aae96f21692cb27a06d6850f3db43336122b52 /main.go | |
| parent | b05b912f15f02d0208599142a4299970cbb6e90b (diff) | |
build(golatt): upgrade to pre-0.4.0
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -10,8 +10,12 @@ import ( "os" ) -//go:embed templates -var templates embed.FS +var ( + //go:embed templates + templates embed.FS + //go:embed dist + assets embed.FS +) var ( domain string @@ -37,7 +41,7 @@ func main() { if configPath == "" { configPath = os.Getenv("NOW_DATA") if configPath == "" { - slog.Error("Config not set. Set it with --cfg relative path or with the env NOW_DATA") + slog.Error("Config not set. Set it with --config relative path or with the env NOW_DATA") return } } @@ -54,7 +58,12 @@ func main() { if err != nil { panic(err) } - g := golatt.New(templates) + var g *golatt.Golatt + if dev { + g = golatt.New(templates, os.DirFS("public"), os.DirFS("dist")) + } else { + g = golatt.New(templates, os.DirFS("public"), golatt.UsableEmbedFS("dist", assets)) + } g.DefaultSeoData = &golatt.SeoData{ Image: cfg.Image, Description: cfg.Description, |
