Updated the header

- added a logo placeholder
- added an active class to the navigation item if the respected page is active
This commit is contained in:
Claudia Reynders 2022-04-30 18:43:10 +02:00
parent abcc738ee4
commit 9e5ba8583b
1 changed files with 6 additions and 3 deletions

View File

@ -1,11 +1,14 @@
{% set navItems = collections.all | eleventyNavigation %} {% set navItems = collections.all | eleventyNavigation %}
<header role="banner"> <header role="banner">
<div class="logo">
<span>My blog</span>
</div>
<nav role="navigation" aria-label="main navigation" > <nav role="navigation" aria-label="main navigation" >
<ul> <ul>
{%- for item in navItems %} {%- for item in navItems %}
<li> <li class="nav__item{{ ' active' if page.url === item.url }}">
<a href="{{ item.url }}">{{ item.key }}</a> <a href="{{ item.url }}">{{ item.key }}</a>
</li> </li>
{%- endfor -%} {%- endfor -%}
</ul> </ul>
</nav> </nav>