website: add godoc.org redirects for the ui, cmd, apps modules

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-08-05 13:34:36 +02:00
parent 7f82b5d637
commit 2d6111e31a
+5 -2
View File
@@ -35,9 +35,12 @@ func vanityHandler(w http.ResponseWriter, r *http.Request) {
</head></html>`)
return
}
switch r.URL.Path {
case "/":
p := r.URL.Path
switch {
case p == "/":
http.Redirect(w, r, "https://git.sr.ht/~eliasnaur/gio", http.StatusFound)
case strings.HasPrefix(p, "/cmd"), strings.HasPrefix(p, "/ui"), strings.HasPrefix(p, "/apps"):
http.Redirect(w, r, "https://godoc.org/gioui.org"+p, http.StatusFound)
default:
http.NotFound(w, r)
}