From 94646c018dfc87a7f1f9e11dc3e85d1af57899f0 Mon Sep 17 00:00:00 2001 From: Mikkel Thestrup Date: Sat, 6 Dec 2025 23:17:58 +0100 Subject: bug fix --- internal/handlers.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'internal/handlers.go') diff --git a/internal/handlers.go b/internal/handlers.go index 5d66be8..09fcaec 100644 --- a/internal/handlers.go +++ b/internal/handlers.go @@ -40,7 +40,21 @@ func (s *Server) handleHTMXPage(c echo.Context) error { if !validPage(page) { return c.String(http.StatusNotFound, "Page not found") } - return s.renderContent(c, page, PageSections[page][0]) + + content, err := s.tmpl.GetContent(page, PageSections[page][0]) + if err != nil { + log.Printf("Error rendering content for %s: %v", page, err) + return c.String(http.StatusInternalServerError, "Error loading content") + } + + data := PageData{ + Page: page, + Pages: ValidPages, + Sections: PageSections[page], + Content: content, + } + + return c.Render(http.StatusOK, "page.html", data) } func (s *Server) handleHTMXSection(c echo.Context) error { -- cgit v1.2.3-70-g09d2