diff options
| author | Mikkel Thestrup <mikkel_thestrup@mithe.dk> | 2025-12-07 02:32:30 +0100 |
|---|---|---|
| committer | Mikkel Thestrup <mikkel_thestrup@mithe.dk> | 2025-12-07 02:32:30 +0100 |
| commit | 67c0494af3863887f3e2b6f6930fdace571606ad (patch) | |
| tree | c87121ac5e75756313fc33ccd8f59c307cf5eb5e /internal/handlers.go | |
| parent | d243b30606673baec988c5cd0a31e450f2794ca4 (diff) | |
| download | web-portfolio-master.tar.gz web-portfolio-master.zip | |
Diffstat (limited to 'internal/handlers.go')
| -rw-r--r-- | internal/handlers.go | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/internal/handlers.go b/internal/handlers.go index 09fcaec..c151904 100644 --- a/internal/handlers.go +++ b/internal/handlers.go @@ -44,10 +44,12 @@ func (s *Server) handleHTMXPage(c echo.Context) error { 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") + return c.String( + http.StatusInternalServerError, + "Error loading content") } - data := PageData{ + data := PageData { Page: page, Pages: ValidPages, Sections: PageSections[page], @@ -75,8 +77,12 @@ func (s *Server) handleHTMXSection(c echo.Context) error { func (s *Server) renderFullPage(c echo.Context, page, section string) error { content, err := s.tmpl.GetContent(page, section) if err != nil { - log.Printf("Error rendering content for %s/%s: %v", page, section, err) - return c.String(http.StatusInternalServerError, "Error loading content") + log.Printf( + "Error rendering content for %s/%s: %v", + page, section, err) + return c.String( + http.StatusInternalServerError, + "Error loading content") } data := PageData{ @@ -93,7 +99,8 @@ func (s *Server) renderContent(c echo.Context, page, section string) error { content, err := s.tmpl.GetContent(page, section) if err != nil { log.Printf("Error rendering content for %s/%s: %v", page, section, err) - return c.String(http.StatusInternalServerError, "Error loading content") + return c.String( + http.StatusInternalServerError, "Error loading content") } return c.HTML(http.StatusOK, string(content)) |