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
4 files changed
tree: 1ff1a1fe48117ac5903ba28d1c45f018fecfe44f
  1. .bazelci/
  2. examples/
  3. scripts/
  4. site/
  5. src/
  6. third_party/
  7. tools/
  8. .bazelrc
  9. .gitattributes
  10. .gitignore
  11. AUTHORS
  12. BUILD
  13. CHANGELOG.md
  14. CODEOWNERS
  15. combine_distfiles.py
  16. combine_distfiles_to_tar.sh
  17. compile.sh
  18. CONTRIBUTING.md
  19. CONTRIBUTORS
  20. distdir.bzl
  21. ISSUE_TEMPLATE.md
  22. LICENSE
  23. README.md
  24. WORKSPACE
README.md

Bazel

{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.

Getting Started

Documentation

Contributing to Bazel

See CONTRIBUTING.md

Build status