build(golatt): upgrade to pre-0.4.0
This commit is contained in:
parent
b05b912f15
commit
a5fe3b2ea2
4 changed files with 21 additions and 8 deletions
|
@ -5,7 +5,7 @@ services:
|
||||||
NOW_DOMAIN: "example.org"
|
NOW_DOMAIN: "example.org"
|
||||||
NOW_CONFIG: "config.json"
|
NOW_CONFIG: "config.json"
|
||||||
volumes:
|
volumes:
|
||||||
- ./data.json:/app/data.json:ro
|
- ./config.json:/app/config.json:ro
|
||||||
- ./assets:/app/public:ro
|
- ./public:/app/public:ro
|
||||||
ports:
|
ports:
|
||||||
- "8000:80"
|
- "8000:80"
|
||||||
|
|
4
go.mod
4
go.mod
|
@ -1,7 +1,7 @@
|
||||||
module now
|
module now
|
||||||
|
|
||||||
go 1.23.2
|
go 1.24
|
||||||
|
|
||||||
require github.com/anhgelus/golatt v0.2.0
|
require github.com/anhgelus/golatt v0.3.1-0.20250224013601-7215f78c2860
|
||||||
|
|
||||||
require github.com/gorilla/mux v1.8.1 // indirect
|
require github.com/gorilla/mux v1.8.1 // indirect
|
||||||
|
|
4
go.sum
4
go.sum
|
@ -2,5 +2,9 @@ github.com/anhgelus/golatt v0.1.0 h1:Lb6wCtbOmIE/p/wlDeFzuFuR++twPx+fHMNVDGhqjXk
|
||||||
github.com/anhgelus/golatt v0.1.0/go.mod h1:Lgyy/Tm9A3w1ft72mZOUxl/p+4G2/WB3qxoXTv7Y4y8=
|
github.com/anhgelus/golatt v0.1.0/go.mod h1:Lgyy/Tm9A3w1ft72mZOUxl/p+4G2/WB3qxoXTv7Y4y8=
|
||||||
github.com/anhgelus/golatt v0.2.0 h1:tdgrx3K61mVYBMy9CNhTheSIV8lPWBl/JjeDIHmz9eg=
|
github.com/anhgelus/golatt v0.2.0 h1:tdgrx3K61mVYBMy9CNhTheSIV8lPWBl/JjeDIHmz9eg=
|
||||||
github.com/anhgelus/golatt v0.2.0/go.mod h1:Lgyy/Tm9A3w1ft72mZOUxl/p+4G2/WB3qxoXTv7Y4y8=
|
github.com/anhgelus/golatt v0.2.0/go.mod h1:Lgyy/Tm9A3w1ft72mZOUxl/p+4G2/WB3qxoXTv7Y4y8=
|
||||||
|
github.com/anhgelus/golatt v0.3.0 h1:HjolihJ+S9egfTXcbk3YBfxBKmEcEraUsqCsrPXzHOU=
|
||||||
|
github.com/anhgelus/golatt v0.3.0/go.mod h1:Lgyy/Tm9A3w1ft72mZOUxl/p+4G2/WB3qxoXTv7Y4y8=
|
||||||
|
github.com/anhgelus/golatt v0.3.1-0.20250224013601-7215f78c2860 h1:Xi1aqbDU1sr/8pJEun4sjOqz5PPQc7hVSR1kuCiRgTE=
|
||||||
|
github.com/anhgelus/golatt v0.3.1-0.20250224013601-7215f78c2860/go.mod h1:Lgyy/Tm9A3w1ft72mZOUxl/p+4G2/WB3qxoXTv7Y4y8=
|
||||||
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
|
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
|
||||||
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
|
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
|
||||||
|
|
15
main.go
15
main.go
|
@ -10,8 +10,12 @@ import (
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
//go:embed templates
|
//go:embed templates
|
||||||
var templates embed.FS
|
templates embed.FS
|
||||||
|
//go:embed dist
|
||||||
|
assets embed.FS
|
||||||
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
domain string
|
domain string
|
||||||
|
@ -37,7 +41,7 @@ func main() {
|
||||||
if configPath == "" {
|
if configPath == "" {
|
||||||
configPath = os.Getenv("NOW_DATA")
|
configPath = os.Getenv("NOW_DATA")
|
||||||
if configPath == "" {
|
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
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +58,12 @@ func main() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
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{
|
g.DefaultSeoData = &golatt.SeoData{
|
||||||
Image: cfg.Image,
|
Image: cfg.Image,
|
||||||
Description: cfg.Description,
|
Description: cfg.Description,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue