Skip to content

Commit acf8668

Browse files
authored
Merge pull request #266 from css-naked-day/feat/current-page
fix: Indicate current page in years
2 parents 7e4117c + acfa15a commit acf8668

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

_assets/public/setup/default.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,3 +459,12 @@
459459
}
460460

461461
}
462+
463+
a:not([href]) {
464+
color: initial;
465+
cursor: auto;
466+
}
467+
468+
[aria-current] {
469+
font-weight: bold;
470+
}

_src/year.njk

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,21 @@ permalink: /{{ year | slugify }}.html
1515
<p>
1616
<a href="/">Home</a>
1717

18-
{% for year in range(globals.yearStart, globals.yearCurrent + 1) %}
19-
{% if participationsCount[year] > 0 %}
20-
· <a href="{{ year | slugify }}.html">{{ year }}</a>
21-
{% else %}
22-
· {{ year }}
23-
{% endif %}
18+
{% for listYear in range(globals.yearStart, globals.yearCurrent + 1) %}
19+
{% set isCurrentPage = listYear === year %}
20+
21+
·
22+
<a
23+
{%- if not isCurrentPage and participationsCount[listYear] > 0 %}
24+
href="{{ listYear | slugify }}.html"
25+
{%- endif %}
26+
27+
{%- if isCurrentPage %}
28+
aria-current="page"
29+
{%- endif %}
30+
>
31+
{{- listYear -}}
32+
</a>
2433
{% endfor %}
2534
</p>
2635

0 commit comments

Comments
 (0)