From 1d8cd59173e9c1e2fd7fd03dd4b2a0ae8a35ef4b Mon Sep 17 00:00:00 2001 From: dzc Date: Fri, 23 Jun 2017 08:26:15 +0200 Subject: Rework jekyll-tree build to add redirects from site root. As described in the commit message for 5596d3b, the new docs.bazel.build site will have one directory per released version and a master directory for the latest documentation at HEAD. This change reworks the jekyll-tree script to construct a final Jekyll tree containing the documentation at HEAD with documentation under /versions/master and redirect pages at the site root for each documentation page. TESTED=scripts/serve-docs.sh RELNOTES: None PiperOrigin-RevId: 159920553 --- site/_includes/head.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'site/_includes') diff --git a/site/_includes/head.html b/site/_includes/head.html index 3eda1bd0f9..b85760db23 100644 --- a/site/_includes/head.html +++ b/site/_includes/head.html @@ -17,11 +17,11 @@ // 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/be/overview.html")); + window.location.replace(current_url.replace(be_url, "https://docs.bazel.build/be/overview.html")); } 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/$2.html#$4")); + window.location.replace(current_url.replace(be_url, "https://docs.bazel.build/be/$2.html#$4")); } // And a short to code reviews var cr_url = new RegExp("^https?://cr(\.bazel.build)?/([0-9]+)") @@ -40,8 +40,7 @@ - - + -- cgit v1.2.3