diff options
| author | Mikkel Thestrup <mikkel@mithe.dk> | 2025-12-24 12:42:45 +0100 |
|---|---|---|
| committer | Mikkel Thestrup <mikkel@mithe.dk> | 2025-12-24 12:42:45 +0100 |
| commit | 36829887c362c58b06ca4e5adea789ee9552d2f3 (patch) | |
| tree | 92cd787e476fb3ac6a1b91c7b4846a7931f06de4 /internal | |
| parent | 67c0494af3863887f3e2b6f6930fdace571606ad (diff) | |
| download | web-portfolio-36829887c362c58b06ca4e5adea789ee9552d2f3.tar.gz web-portfolio-36829887c362c58b06ca4e5adea789ee9552d2f3.zip | |
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/handlers.go | 15 | ||||
| -rw-r--r-- | internal/models.go | 4 |
2 files changed, 13 insertions, 6 deletions
diff --git a/internal/handlers.go b/internal/handlers.go index c151904..92f7a4f 100644 --- a/internal/handlers.go +++ b/internal/handlers.go @@ -46,7 +46,8 @@ func (s *Server) handleHTMXPage(c echo.Context) error { log.Printf("Error rendering content for %s: %v", page, err) return c.String( http.StatusInternalServerError, - "Error loading content") + "Error loading content", + ) } data := PageData { @@ -79,10 +80,14 @@ func (s *Server) renderFullPage(c echo.Context, page, section string) error { if err != nil { log.Printf( "Error rendering content for %s/%s: %v", - page, section, err) + page, + section, + err, + ) return c.String( http.StatusInternalServerError, - "Error loading content") + "Error loading content", + ) } data := PageData{ @@ -100,7 +105,9 @@ func (s *Server) renderContent(c echo.Context, page, section string) error { if err != nil { log.Printf("Error rendering content for %s/%s: %v", page, section, err) return c.String( - http.StatusInternalServerError, "Error loading content") + http.StatusInternalServerError, + "Error loading content", + ) } return c.HTML(http.StatusOK, string(content)) diff --git a/internal/models.go b/internal/models.go index 4c8b4e0..097b852 100644 --- a/internal/models.go +++ b/internal/models.go @@ -9,14 +9,14 @@ const ( PageContact = "contact" ) -var ValidPages = []string{ +var ValidPages = []string { PageHome, PageProjects, PageResume, PageContact, } -var PageSections = map[string][]string{ +var PageSections = map[string][]string { PageHome: {"intro", "about"}, PageProjects: {"intro", "kal"}, PageResume: {"intro", "BSc Comp. Sci."}, |