Show currently selected nav item

This commit is contained in:
Emil Miler 2023-04-03 19:49:53 +02:00
parent 72fbf5d212
commit 4ed10e5bc0
2 changed files with 10 additions and 1 deletions

View File

@ -61,6 +61,11 @@ nav {
display:flex;
justify-content:center;
background:$nav-background-secondary;
a.active {
color: $nav-anchor-hover-color;
background-color: $nav-background-primary;
}
}
}

View File

@ -42,7 +42,11 @@
{% macro subnav() %}
<ul>
{% for item in config.extra.menu %}
<li><a href="{{ item.path }}">{{ item.name }}</a></li>
<li><a href="{{ item.path }}"
{% if item.path == current_path %}
class="active"
{% endif %}
>{{ item.name }}</a></li>
{% endfor %}
</ul>
{% endmacro subnav %}