Merge pull request #3 from philall/fix_navbar

fix is active logic
This commit is contained in:
Worble 2019-08-27 01:14:08 +01:00 committed by GitHub
commit aa34f7dcd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,8 +77,10 @@
<div class="navbar-end">
{% if config.extra.zulma_menu %}
{% for item in config.extra.zulma_menu %}
{% set item_url = item.url | replace(from="$BASE_URL", to=config.base_url) %}
{% set item_url = item_url ~ "/" %}
<a itemprop="url"
class="navbar-item {% if item.url | replace(from="$BASE_URL", to=config.base_url) == current_url %}is-active{% endif %}"
class="navbar-item {% if item_url == current_url %}is-active{% endif %}"
href="{{ item.url | safe | replace(from="$BASE_URL", to=config.base_url) }}">
<span itemprop="name">{{ item.name }}
</span>