all repos — website @ b7d3ee578a0fa7c482c386242f2fc52c2600568a

My website

fix early panic
Alan Pearce alan@alanpearce.eu
Tue, 25 Jun 2024 18:13:56 +0200
commit

b7d3ee578a0fa7c482c386242f2fc52c2600568a

parent

14543af1635fffd07ff97e6d69a3ff70a85d1e3e

2 files changed, 2 insertions(+), 1 deletions(-)

jump to
M internal/website/mux.gointernal/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.templtemplates/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)