diff options
author | Alan Pearce | 2024-06-25 18:13:56 +0200 |
---|---|---|
committer | Alan Pearce | 2024-06-25 18:13:56 +0200 |
commit | b7d3ee578a0fa7c482c386242f2fc52c2600568a (patch) | |
tree | 8cdaed663e0a5eeb5c9ac79ef8fa6b6eb2d41363 | |
parent | 14543af1635fffd07ff97e6d69a3ff70a85d1e3e (diff) | |
download | website-b7d3ee578a0fa7c482c386242f2fc52c2600568a.tar.lz website-b7d3ee578a0fa7c482c386242f2fc52c2600568a.tar.zst website-b7d3ee578a0fa7c482c386242f2fc52c2600568a.zip |
fix early panic
-rw-r--r-- | internal/website/mux.go | 1 | ||||
-rw-r--r-- | templates/page.templ | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/internal/website/mux.go b/internal/website/mux.go index 2d1b971..a6e7ba0 100644 --- a/internal/website/mux.go +++ b/internal/website/mux.go @@ -74,6 +74,7 @@ func NewMux(cfg *config.Config, root string) (mux *http.ServeMux, err error) { 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) diff --git a/templates/page.templ b/templates/page.templ index 1667fb0..7869369 100644 --- a/templates/page.templ +++ b/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) |