Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions templates/download-layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% extends "left-aside.html" %}

{#- The download pages: /download/, the release list, the release line pages
and each release. They have their own menu, as the blog has its own
sidebar. -#}

{% block related_content %}
{#- The release line of a line page (extra.version) or a release page (extra.tag). -#}
{% set line = "" %}
{% if page is defined and page.extra?.version %}
{% set line = page.extra.version %}
{% elif page is defined and page.extra?.tag %}
{% set line = (page.extra.tag | split(pat="."))[:2] | join(sep=".") %}
{% endif %}
{{< download_menu path={current_path} line={line} />}}
{% endblock related_content %}
6 changes: 2 additions & 4 deletions templates/download.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{% extends "right-aside.html" %}
{% extends "download-layout.html" %}

{% block subhead_content%}
<h1 class="page-title">Download Valkey</h1>
{% endblock subhead_content%}
{% block main_content %}
<h1 class="docs-page-title">Download Valkey</h1>

{# The newest stable release on each major.minor line, newest line first. Same
selection as the homepage in index.html. Pages are newest first, so within a
Expand Down
23 changes: 23 additions & 0 deletions templates/macros/release.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,26 @@ <h4>Binary Artifacts</h4>
{% endfor %}
{% endif %}
{% endcomponent release_info %}

{#
The menu on the download pages: the download page, each release line,
newest first, and all releases. The lines are the pages in
content/download/versions/, so a new line shows up once it has a page.
Styled like the docs menu.
path: the current page's path.
line: the release line of the current page, e.g. "9.1", or "".
#}
{% component download_menu(path, line="") %}
{%- set versions = get_section(path="download/versions/_index.md") %}
{%- set lines = [{"version": (p.extra.version | split(pat=".") | first | int) * 1000 + (p.extra.version | split(pat=".") | nth(n=1) | int), "page": p} for p in versions.pages] %}
<nav class="docs-menu" aria-labelledby="download-menu-title">
<h2 id="download-menu-title">Download</h2>
<ul>
<li><a href="/download/"{% if path == "/download/" %} class="docs-menu-current" aria-current="page"{% endif %}>Overview</a></li>
{%- for l in lines | sort(attribute="version") | reverse %}
<li><a href="{{ l.page.path }}"{% if l.page.extra.version == line %} class="docs-menu-current" aria-current="{{ "page" if path == l.page.path else "true" }}"{% endif %}>Valkey {{ l.page.extra.version }}</a></li>
{%- endfor %}
<li><a href="/download/releases/"{% if path == "/download/releases/" %} class="docs-menu-current" aria-current="page"{% endif %}>All releases</a></li>
</ul>
</nav>
{% endcomponent download_menu %}
7 changes: 2 additions & 5 deletions templates/release-line.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{% extends "right-aside.html" %}

{% block subhead_content %}
<h1 class="page-title">Download Valkey {{ page.extra.version }}</h1>
{% endblock subhead_content %}
{% extends "download-layout.html" %}

{% block main_content %}
<h1 class="docs-page-title">Download Valkey {{ page.extra.version }}</h1>
{% set line = page.extra.version %}

{# Every release on this line, newest first, stable and pre-release kept apart. #}
Expand Down
6 changes: 2 additions & 4 deletions templates/release-page.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "right-aside.html" %}
{% extends "download-layout.html" %}

{% block subhead_content%}
<h1 class="page-title">Download Valkey {{page.title}}</h1>
{% endblock subhead_content%}
{% block main_content %}
<h1 class="docs-page-title">Download Valkey {{page.title}}</h1>
{{< release_info date={page.date} release={page.extra} />}}
{% endblock main_content %}
6 changes: 2 additions & 4 deletions templates/release-section.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{% extends "right-aside.html" %}
{% extends "download-layout.html" %}

{% block subhead_content%}
<h1 class="page-title">Valkey Releases</h1>
{% endblock subhead_content%}
{% block main_content %}
<h1 class="docs-page-title">Valkey Releases</h1>

{# Newest line first by version, not date: an older line's patch can ship after
the newest line's. #}
Expand Down
Loading