Add aria-current if on the current page
This commit is contained in:
parent
8c4e5b1e41
commit
13f27458d7
|
@ -1,7 +1,13 @@
|
|||
{% set currentUrl %}{{ page.url }}{% endset %}
|
||||
|
||||
<nav class="navbar">
|
||||
<ul class="nav__menu">
|
||||
{% for page in collections.pages %}
|
||||
<li><a href="{{ page.url }}">{{ page.data.title or page.data.metadata.title }}</a></li>
|
||||
<li>
|
||||
<a href="{{ page.url }}" {% if currentUrl === page.url %}aria-current="page"{% endif %}>
|
||||
{{ page.data.title or page.data.metadata.title }}
|
||||
</a>
|
||||
</li>
|
||||
{%- endfor %}
|
||||
<li><a href="https://leilukin.123guestbook.com/">Guestbook</a></li>
|
||||
</ul>
|
||||
|
|
Loading…
Reference in New Issue