summaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2019-06-12 10:17:58 -0700
committerAdin Scannell <adin@scannell.ca>2019-06-12 13:59:15 -0700
commitc1636b150ab0041782634b3d5909ec818675e14d (patch)
tree12317f96af10d386dcc0066179a33361528ab169 /cmd
parent483794db83cf238ba0825a7a0ec0b47b4e173bc3 (diff)
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.
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gvisor-website/main.go16
1 files changed, 11 insertions, 5 deletions
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 = `<meta name="go-import" content="gvisor.dev git https://github.com/google/gvisor">`
+ goGetHeader = `<meta name="go-import" content="gvisor.dev/gvisor git https://github.com/google/gvisor">`
goGetHTML5 = `<!doctype html><html><head><meta charset=utf-8>` + goGetHeader + `<title>Go-get</title></head><body></html>`
)