summaryrefslogtreecommitdiff
path: root/internal/handlers.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/handlers.go')
-rw-r--r--internal/handlers.go17
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))