From ce5dccf67261da88e4d6d9413090f3db5f312a63 Mon Sep 17 00:00:00 2001 From: Damien Martin-Guillerez Date: Fri, 11 Nov 2016 20:12:04 +0000 Subject: Redirects be.bazel.build and cr.bazel.build to the Build Encyclopedia and Gerrit https://be.bazel.build/c-cpp/cc_binary will now redirect to the cc_binary rules, as well as https://be.bazel.build/c-cpp#cc_binary https://be.bazel.build will now redirect to the documentation index https://cr.bazel.build will now redirect to the gerrit dashboard https://cr.bazel.build/42 will now redirect to the gerrit code review 42 -- MOS_MIGRATED_REVID=138904300 --- site/_includes/head.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'site/_includes') 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/")); + } -- cgit v1.2.3