fix early panic
Alan Pearce alan@alanpearce.eu
Tue, 25 Jun 2024 18:13:56 +0200
2 files changed, 2 insertions(+), 1 deletions(-)
M internal/website/mux.go → internal/website/mux.go
@@ -74,6 +74,7 @@ err = registerContentFiles(prefix) if err != nil { return nil, errors.WithMessagef(err, "registering content files") } + templates.Setup() mux.Handle("/", wrapHandler(cfg, func(w http.ResponseWriter, r *http.Request) *HTTPError { urlPath, shouldRedirect := canonicalisePath(r.URL.Path)
M templates/page.templ → templates/page.templ
@@ -11,7 +11,7 @@ var ( css string ) -func init() { +func Setup() { bytes, err := fs.ReadFile(Files, "style.css") if err != nil { panic(err)