commit | 565f7742d584588bd3b329ce7303bd2673b3a284 | [log] [tgz] |
---|---|---|
author | wyv <wyv@google.com> | Fri May 29 00:41:43 2020 -0700 |
committer | Copybara-Service <copybara-worker@google.com> | Fri May 29 00:43:03 2020 -0700 |
tree | 1ff1a1fe48117ac5903ba28d1c45f018fecfe44f | |
parent | acab2c264811810e306a8ddd67c6939c2f50741a [diff] |
Fix all the redirects! ## The problems Today, //site/docs/index.md is a redirect to https://docs.bazel.build/versions/3.2.0/bazel-overview.html (because 3.2.0 is the latest release version). This seems fine until you remember that //site/docs/index.md does *not* represent https://docs.bazel.build/index.html, rather https://docs.bazel.build/versions/$ANY_VERSION/index.html ! This means that, for example, even https://docs.bazel.build/versions/2.1.0/index.html will point to the 3.2.0 landing page. Not great. To make matters more confusing, https://docs.bazel.build/$SOME_PATH is automatically redirected to https://docs.bazel.build/versions/master/$SOME_PATH . This seems undesirable since we want unversioned URLs to redirect to the latest release version, not master. But wait, how come the home page isn't broken? https://docs.bazel.build/index.html redirects to https://docs.bazel.build/versions/master/index.html, which -- thanks to the problem described in the first paragraph -- redirects again to https://docs.bazel.build/versions/3.2.0/bazel-overview.html . It ends up working by a fluke! Furthermore, //site/docs/index.md, being a markdown file, contains raw HTML. This is actually a subtle time bomb since its indented HTML formatting is incompatible with the popular GitHub flavored markdown, which is the reason why the previous attempt to switch to GFM caused a home page outage. ## The fix For the first problem, we change //site/docs/index.md to be a redirect to the relative path "bazel-overview.html", which means that the 2.1.0 version of index.html will point to the 2.1.0 version of bazel-overview.html. For the second problem, we change //site/jekyll-tree.sh to always make the root directory redirects point at the latest released version, instead of master. For the third problem, we simply make //site/docs/index.md use the redirect layout (this is now possible since we don't have a variable in the redirect target anymore). It's now compatible with *any* markdown format, since it's empty. Perfect! RELNOTES: PiperOrigin-RevId: 313735647
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.
One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.
Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.
Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.
Follow our tutorials:
See CONTRIBUTING.md