Valentin Brandl 5a03c74642
All checks were successful
Build / build (pull_request) Successful in 1m18s
Lint / lint (pull_request) Successful in 2m9s
Fix lints
2025-04-09 14:47:05 +02:00

31 lines
650 B
Go

package handlers
import (
"html/template"
"git.vbrandl.net/vbrandl/go-web-template/assets"
)
var indexTemplate *template.Template
var notFoundTemplate *template.Template
type templateData struct {
RequestID string
}
func (app *Application) ParseTemplates() error {
t, err := template.ParseFS(assets.Templates, "public/html/index.html", "public/html/navbar.tmpl", "public/html/footer.tmpl")
if err != nil {
return err
}
indexTemplate = t
t, err = template.ParseFS(assets.Templates, "public/html/notFound.html", "public/html/navbar.tmpl", "public/html/footer.tmpl")
if err != nil {
return err
}
notFoundTemplate = t
return nil
}