Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6ab4ffd

Browse filesBrowse files
authored
Fix year delimiters in releases page (#1615)
The previous approach to detect if a release is the last one in a year was incorrect. It checked if the following post was in the next year. However, the following post doesn't have to be a release, so the check could fail. The result was missing year delimiters "Releases in YYYY". A mutable variable makes it easier to track the actual year of the last rendered release post.
1 parent f0c9504 commit 6ab4ffd
Copy full SHA for 6ab4ffd

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎templates/releases.html

Copy file name to clipboardExpand all lines: templates/releases.html
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@
3232
{%- set day = page.components | nth(n=num_comps - 2) | int %}
3333
{%- if loop.index0 == 0 %}
3434
{{ macros::show_year(year=year, post_name="Releases") }}
35+
{%- set_global prev_year = year %}
3536
{%- endif %}
3637

3738
{%- if page.extra is containing("release") %}
3839
{%- if loop.index0 != 0 %}
39-
{%- set prev_idx = loop.index0 - 1 %}
40-
{%- set prev_year = rev_pages[prev_idx].components | nth(n=num_comps - 4) | int %}
4140
{%- if prev_year != year %}
4241
{{ macros::show_year(year=year, post_name="Releases") }}
42+
{%- set_global prev_year = year %}
4343
{%- endif %}
4444
{%- endif %}
4545
{% if page.show_year %}<tr>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.