Skip to content

Commit

Permalink
Adjust logic for hiding feature highlights links
Browse files Browse the repository at this point in the history
  • Loading branch information
mdlinville committed Aug 9, 2024
1 parent a83c176 commit 02dfef5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 13 deletions.
28 changes: 16 additions & 12 deletions src/current/_includes/releases/whats-new-intro.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% assign DEBUG = true %}
{% assign branched = false %}
{% assign ancient = false %}
{% assign old = false %}
{% assign no_highlights = false %}
{% assign skippable = false %}
Expand All @@ -20,27 +19,33 @@
{% endunless %}
{% endfor %}

{% comment %}Some old pages need different links to install and upgrade pages{% endcomment %}
{% if page.major_version == 'v1.0' or page.major_version == 'v1.1' or page.major_version == 'v2.0' or page.major_version == 'v2.1' or page.major_version == 'v21.1' %}
{% comment %}Some old pages don't have feature highlights and won't get LTS{% endcomment %}
{% if page.major_version == 'v1.0' or
page.major_version == 'v1.1' or
page.major_version == 'v2.0' or
page.major_version == 'v2.1' or
page.major_version == 'v19.1' or
page.major_version == 'v19.2' or
page.major_version == 'v20.1' or
page.major_version == 'v20.2' or
page.major_version == 'v21.1' or
page.major_version == 'v21.2' or
page.major_version == 'v22.1' or
page.major_version == 'v22.2' %}
{% assign branched = true %}
{% assign ancient = true %}
{% assign no_highlights = true %}
{% assign will_never_have_lts = true %}
{% endif %}

{% if page.major_version == 'v1.0' or page.major_version == 'v1.1' or page.major_version == 'v2.0' or page.major_version == 'v2.1' or page.major_version == 'v21.1' %}
{% capture install_link %}[install CockroachDB](https://cockroachlabs.com/docs/{{ page.major_version}}/install-cockroachdb.html){% endcapture %}
{% capture install_sentence %}After downloading a supported CockroachDB binary, learn how to {{ install_link }}.{% endcapture %}
{% elsif page.major_version == 'v19.1' or page.major_version == 'v19.2' or page.major_version == 'v20.1' or page.major_version == 'v20.2' %}
{% assign branched = true %}
{% assign no_highlights = true %}
{% assign will_never_have_lts = true %}
{% capture install_link %}[install CockroachDB](https://cockroachlabs.com/docs/{{ page.major_version}}/install-cockroachdb.html){% endcapture %}
{% capture upgrade_link %}[upgrade your cluster](https://cockroachlabs.com/docs/{{ page.major_version }}/upgrade-cockroach-version.html){% endcapture %}
{% capture install_sentence %}After downloading a supported CockroachDB binary, learn how to {{ install_link }} or {{ upgrade_link }}.{% endcapture %}
{% else %}
{% if branched %}
{% if page.major_version == 'v21.1' or page.major_version == 'v21.2' or page.major_version == 'v22.2' %}
{% assign will_never_have_lts = true %}
{% assign no_highlights = true %}
{% endif %}
{% capture install_link %}[install CockroachDB](/docs/{{ page.major_version }}/install-cockroachdb.html){% endcapture %}
{% capture upgrade_link %}[upgrade your cluster](/docs/{{ page.major_version }}/upgrade-cockroach-version.html){% endcapture %}
{% else %}
Expand All @@ -63,7 +68,6 @@
{% if DEBUG == true %}
include.major_version: {{ include.major_version }}<br />
page.major_version: {{ page.major_version }}<br />
ancient: {{ ancient }}<br />
branched: {{ branched }}<br />
will_never_have_lts: {{ will_never_have_lts }}<br />
lts: {{ lts }}<br />
Expand Down
17 changes: 16 additions & 1 deletion src/current/releases/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,22 @@ CockroachDB {{ v.major_version }} is an [Innovation release](#major-releases), w
{% else %}
CockroachDB {{ v.major_version }} is a [Regular release](#major-releases) for all clusters, which is required for all CockroachDB cluster upgrades.
{% endif %}
Refer to [Major release types](#major-releases) before installing or upgrading for release support details. To learn what’s new in this release, refer to [Feature Highlights]({% link releases/{{ v.major_version }}.md %}#feature-highlights).
Refer to [Major release types](#major-releases) before installing or upgrading for release support details.
% comment %}Some old pages don't have feature highlights and won't get LTS{% endcomment %}
{% unless v.major_version == 'v1.0' or
v.major_version == 'v1.1' or
v.major_version == 'v2.0' or
v.major_version == 'v2.1' or
v.major_version == 'v19.1' or
v.major_version == 'v19.2' or
v.major_version == 'v20.1' or
v.major_version == 'v20.2' or
v.major_version == 'v21.1' or
v.major_version == 'v21.2' or
v.major_version == 'v22.1' or
v.major_version == 'v22.2' %}
To learn what’s new in this release, refer to [Feature Highlights]({% link releases/{{ v.major_version }}.md %}#feature-highlights).
{% endunless %}

<div id="os-tabs" class="filters filters-big clearfix">
<button id="linux" class="filter-button" data-scope="linux">Linux</button>
Expand Down

0 comments on commit 02dfef5

Please sign in to comment.