Convert templates to pongo2
This commit is contained in:
parent
266cd2f4d2
commit
d61e607b8a
22 changed files with 311 additions and 136 deletions
10
main.go
10
main.go
|
|
@ -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",
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue