aboutsummaryrefslogtreecommitdiffhomepage
path: root/site/_includes
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2016-11-11 20:12:04 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2016-11-14 14:55:00 +0000
commitce5dccf67261da88e4d6d9413090f3db5f312a63 (patch)
treecf986f635b1e485e92849c3a635cad894a14216a /site/_includes
parentc812c02ddb761aeaa85c7b7d2a04248cef96da00 (diff)
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
Diffstat (limited to 'site/_includes')
-rw-r--r--site/_includes/head.html19
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 }}">