aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorWilliam Hergès <william@herges.fr>2025-09-07 16:48:17 +0200
committerWilliam Hergès <william@herges.fr>2025-09-07 16:48:17 +0200
commit26d21b4fa9c703a84b34ceabc13d0d5e19c90e98 (patch)
tree9236f03838a61be1f222a6a87827390d62113bd3 /main.go
parent996ff551f05dee6db08c8eb4144e7db4a5dbeaa2 (diff)
feat(404): better handle
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.go b/main.go
index 6df8e79..3f8d3c2 100644
--- a/main.go
+++ b/main.go
@@ -140,6 +140,14 @@ func main() {
}
g.NotFoundHandler = func(w http.ResponseWriter, r *http.Request) {
+ g.Render(w, "404", &golatt.TemplateData{
+ Title: "Not found :(",
+ SEO: &golatt.SeoData{
+ URL: r.URL.Path,
+ Description: "Not found",
+ },
+ Data: &cfg,
+ })
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
}