From c1636b150ab0041782634b3d5909ec818675e14d Mon Sep 17 00:00:00 2001 From: Adin Scannell Date: Wed, 12 Jun 2019 10:17:58 -0700 Subject: Add /pr support for links. This also updates the canonical package name to include a /gvisor suffix. This is more flexible to allow for future packages or git hook interception. --- cmd/gvisor-website/main.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'cmd/gvisor-website') diff --git a/cmd/gvisor-website/main.go b/cmd/gvisor-website/main.go index 00af4549e..37b78b7c5 100644 --- a/cmd/gvisor-website/main.go +++ b/cmd/gvisor-website/main.go @@ -30,28 +30,34 @@ import ( ) var redirects = map[string]string{ - "/change": "https://gvisor.googlesource.com/gvisor/", - "/cl": "https://gvisor-review.googlesource.com/", + "/change": "https://github.com/google/gvisor", "/issue": "https://github.com/google/gvisor/issues", "/issue/new": "https://github.com/google/gvisor/issues/new", + "/pr": "https://github.com/google/gvisor/pulls", // Redirects to compatibility docs. "/c": "/docs/user_guide/compatibility", "/c/linux/amd64": "/docs/user_guide/compatibility/amd64", + + // Deprecated, but links continue to work. + "/cl": "https://gvisor-review.googlesource.com", } var prefixHelpers = map[string]string{ - "cl": "https://gvisor-review.googlesource.com/c/gvisor/+/%s", - "change": "https://gvisor.googlesource.com/gvisor/+/%s", + "change": "https://github.com/google/gvisor/commit/%s", "issue": "https://github.com/google/gvisor/issues/%s", + "pr": "https://github.com/google/gvisor/pull/%s", // Redirects to compatibility docs. "c/linux/amd64": "/docs/user_guide/compatibility/amd64/#%s", + + // Deprecated, but links continue to work. + "cl": "https://gvisor-review.googlesource.com/c/gvisor/+/%s", } var ( validId = regexp.MustCompile(`^[A-Za-z0-9-]*/?$`) - goGetHeader = `` + goGetHeader = `` goGetHTML5 = `` + goGetHeader + `Go-get` ) -- cgit v1.2.3