Skip to content

Commit

Permalink
Only add "Updating Bazel" link on master or > 0.28 docs.
Browse files Browse the repository at this point in the history
Fixes bazelbuild#9056.

Closes bazelbuild#9057.

PiperOrigin-RevId: 261295420
  • Loading branch information
dslomov authored and copybara-github committed Aug 2, 2019
1 parent a6b5b05 commit 5f2b552
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions site/_layouts/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
<!-- /versions/0.12.3/baz.md -> ["0.12.3", "baz.md"] -->
{% assign versioned_url_parts = page.url | split: '/' | shift | shift %}
{% assign current_version = versioned_url_parts.first %}
{% assign version_components = current_version | split: '.' %}
{% if version_components.size < 2 %}
{% assign major_version = "master" %}
{% assign minor_version = "master" %}
{% else % }
{% assign minor_version = version_components[0] | plus:0 %}
{% assign minor_version = version_components[1] | plus:0 %}
{% endif %}

<!DOCTYPE html>
<html lang="en" itemscope itemtype="https://schema.org/WebPage">
Expand Down Expand Up @@ -68,9 +76,11 @@ <h3>Installing and Using Bazel</h3>
</ul>
</li>

{% if major_version == "master" or major_version > 0 or minor_version > 28 %}
<li class="sidebar-nav">
<a href="/versions/{{ current_version }}/updating-bazel.html">Updating Bazel</a>
</li>
{% endif %}

<li>
<a class="sidebar-nav-heading" data-toggle="collapse"
Expand Down

0 comments on commit 5f2b552

Please sign in to comment.