From 2d6111e31a210620c587d419ad89522db9dda808 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 5 Aug 2019 13:34:36 +0200 Subject: [PATCH] website: add godoc.org redirects for the ui, cmd, apps modules Signed-off-by: Elias Naur --- website/main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/website/main.go b/website/main.go index f74d17ca..77cfc725 100644 --- a/website/main.go +++ b/website/main.go @@ -35,9 +35,12 @@ func vanityHandler(w http.ResponseWriter, r *http.Request) { `) 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) }