alpha
Login
or
Join now
4uffin.bsky.social
/
core
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
My own copy of Tangled :)
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
appview: error templates
author
Anirudh Oppiliappan
date
1 year ago
(Feb 14, 2025, 10:59 AM +0200)
commit
1f52d787
1f52d78776bc7510365eecee8b9aad17c5f31eec
parent
baea85cd
baea85cd5508a4b3d86ec65a3558446d4c4a13e1
+25
-20
4 changed files
Expand all
Collapse all
Unified
Split
appview
pages
pages.go
templates
errors
404.html
500.html
state
state.go
+8
appview/pages/pages.go
Reviewed
···
248
248
}
249
249
return http.StripPrefix("/static/", http.FileServer(http.FS(sub)))
250
250
}
251
251
+
252
252
+
func (p *Pages) Error500(w io.Writer) error {
253
253
+
return p.execute("errors/500", w, nil)
254
254
+
}
255
255
+
256
256
+
func (p *Pages) Error404(w io.Writer) error {
257
257
+
return p.execute("errors/404", w, nil)
258
258
+
}
+5
-10
appview/pages/templates/errors/404.html
Reviewed
···
1
1
-
<html>
2
2
-
<title>404</title>
3
3
-
{{ template "layouts/head" . }}
4
4
-
<body>
5
5
-
{{ template "layouts/nav" . }}
6
6
-
<main>
7
7
-
<h3>404 — nothing like that here.</h3>
8
8
-
</main>
9
9
-
</body>
10
10
-
</html>
1
1
+
{{ define "title" }}404 · tangled{{ end }}
2
2
+
3
3
+
{{ define "content" }}
4
4
+
<h3>404 — nothing like that here!</h3>
5
5
+
{{ end }}
+5
-10
appview/pages/templates/errors/500.html
Reviewed
···
1
1
-
<html>
2
2
-
<title>500</title>
3
3
-
{{ template "layouts/head" . }}
4
4
-
<body>
5
5
-
{{ template "layouts/nav" . }}
6
6
-
<main>
7
7
-
<h3>500 — something broke!</h3>
8
8
-
</main>
9
9
-
</body>
10
10
-
</html>
1
1
+
{{ define "title" }}500 · tangled{{ end }}
2
2
+
3
3
+
{{ define "content" }}
4
4
+
<h3>500 — something broke!</h3>
5
5
+
{{ end }}
+7
appview/state/state.go
Reviewed
···
612
612
})
613
613
})
614
614
615
615
+
r.NotFound(func(w http.ResponseWriter, r *http.Request) {
616
616
+
s.pages.Error404(w)
617
617
+
})
618
618
+
615
619
return r
616
620
}
617
621
···
660
664
661
665
r.Get("/keys/{user}", s.Keys)
662
666
667
667
+
r.NotFound(func(w http.ResponseWriter, r *http.Request) {
668
668
+
s.pages.Error404(w)
669
669
+
})
663
670
return r
664
671
}