Convert templates to pongo2

This commit is contained in:
William Bouzourène 2024-12-22 15:17:05 +01:00
parent 266cd2f4d2
commit d61e607b8a
Signed by: bouzoure
SSH key fingerprint: SHA256:19MbXpLua4rUtk8tunMesD8KUKb91LXLHg8E/qTooww
22 changed files with 311 additions and 136 deletions

10
main.go
View file

@ -12,7 +12,7 @@ import (
"git.readonly.ch/bouzoure/popvaud-people/middlewares"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"
"github.com/gofiber/template/pug/v2"
"github.com/gofiber/template/django/v3"
)
//go:embed static/*
@ -49,9 +49,9 @@ func main() {
}
// Create a new engine
var engine *pug.Engine
var engine *django.Engine
if config.Debug {
engine = pug.New("./views", ".pug")
engine = django.New("./views", ".html")
engine.ShouldReload = true
} else {
embedViews2, err := fs.Sub(embedViews, "views")
@ -59,9 +59,9 @@ func main() {
log.Fatal(err)
}
engine = pug.NewFileSystem(
engine = django.NewFileSystem(
http.FS(embedViews2),
".pug",
".html",
)
}