diff options
Diffstat (limited to 'site/_includes/head.html')
-rw-r--r-- | site/_includes/head.html | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/site/_includes/head.html b/site/_includes/head.html index 664bcdef72..bfb266f3f2 100644 --- a/site/_includes/head.html +++ b/site/_includes/head.html @@ -14,6 +14,25 @@ if (http_url.test(current_url)) { window.location.replace(current_url.replace(http_url, "https://bazel.build/")); } + // Do a shortcut so that be.bazel.build redirect to the build encyclopedia + var be_url = new RegExp("^https?://be(\.bazel.build)?/?"); + if (be_url.test(current_url)) { + window.location.replace(current_url.replace(be_url, "https://bazel.build/docs")); + } + var be_url = new RegExp("^https?://be(\.bazel.build)?/([a-zA-Z0-9_-]+)([/#](.*))?"); + if (be_url.test(current_url)) { + window.location.replace(current_url.replace(be_url, "https://bazel.build/docs/be/$3.html#$5")); + } + // And a short to code reviews + var cr_url = new RegExp("^https?://cr(\.bazel.build)?/([0-9]+)") + if (cr_url.test(current_url)) { + window.location.replace(current_url.replace(cr_url, "https://bazel-review.googlesource.com/c/$2")); + } + // Code review dashboard + var cr_url = new RegExp("^https?://cr(\.bazel.build)?/?") + if (cr_url.test(current_url)) { + window.location.replace(current_url.replace(cr_url, "https://bazel-review.googlesource.com/")); + } </script> <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site_root }}"> |