fix is active logic
This commit is contained in:
parent
b6bf2cfed7
commit
9c90f940a7
1 changed files with 3 additions and 1 deletions
|
@ -77,8 +77,10 @@
|
||||||
<div class="navbar-end">
|
<div class="navbar-end">
|
||||||
{% if config.extra.zulma_menu %}
|
{% if config.extra.zulma_menu %}
|
||||||
{% for item in 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"
|
<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) }}">
|
href="{{ item.url | safe | replace(from="$BASE_URL", to=config.base_url) }}">
|
||||||
<span itemprop="name">{{ item.name }}
|
<span itemprop="name">{{ item.name }}
|
||||||
</span>
|
</span>
|
||||||
|
|
Loading…
Add table
Reference in a new issue