Skip to content

Commit 00ad78a

Browse files
committed
select menu by permalink
1 parent e5c1eea commit 00ad78a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

_includes/header.liquid

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@
6363
{% if p.dropdown %}
6464
{% assign has_active_child = false %}
6565
{% for child in p.children %}
66-
{% if page.title == child.title %}
66+
{% if page.title == child.title or page.permalink == child.permalink %}
6767
{% assign has_active_child = true %}
6868
{% endif %}
6969
{% endfor %}
70-
<li class="nav-item dropdown {% if page.title == p.title or has_active_child %}active{% endif %}">
70+
<li class="nav-item dropdown {% if page.title == p.title or page.permalink == p.permalink or has_active_child %}active{% endif %}">
7171
<a
7272
class="nav-link dropdown-toggle"
7373
href="#"
@@ -78,7 +78,7 @@
7878
aria-expanded="false"
7979
>
8080
{{- p.title }}
81-
{% if page.title == p.title or has_active_child %}
81+
{% if page.title == p.title or page.permalink == p.permalink or has_active_child %}
8282
<span class="sr-only">(current)</span>
8383
{% endif %}
8484
</a>
@@ -88,7 +88,7 @@
8888
<div class="dropdown-divider"></div>
8989
{% else %}
9090
<a
91-
class="dropdown-item {% if page.title == child.title %}active{% endif %}"
91+
class="dropdown-item {% if page.title == child.title or page.permalink == child.permalink %}active{% endif %}"
9292
href="{% if child.permalink contains '://' %}{{ child.permalink }}{% else %}{{ child.permalink | relative_url }}{% endif %}"
9393
>
9494
{{- child.title -}}

0 commit comments

Comments
 (0)