website: redirect unknown patsh to godoc

With the renamed gioui.org module, any path could be a Gio package.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-09-30 12:49:19 +02:00
parent 962bc36dac
commit 049c0b4dcd
+1 -3
View File
@@ -69,9 +69,7 @@ func vanityHandler(w http.ResponseWriter, r *http.Request) {
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)
http.Redirect(w, r, "https://godoc.org/gioui.org"+p, http.StatusFound)
}
}