Skip to content

Commit afd1045

Browse files
authored
Update header.html
1 parent da84b23 commit afd1045

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

_includes/header.html

+17-13
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,32 @@
88
<ul>
99
{% for item in site.data.menu %}
1010
{% if item.subitems != null %}
11+
<li class="{% if current_page.last == item.slug %} active{% endif %}{% if item.subitems != null %} has-children{% endif %}">
1112
{% if item.url != null %}
1213
<a href="{{ item.url }}/">{{ item.title }}</a>
1314
{% else %}
14-
<li class="{% if current_page.last == item.slug %} active{% endif %}{% if item.subitems != null %} has-children{% endif %}">
15-
<a href="{{ site.baseurl }}/{{ item.slug }}/">{{ item.title }}</a></li>
16-
<ul>
17-
{% for subcategory in item.subitems %}
18-
<li{% if current_page.last == subcategory.subslug %} class='active'{% endif %}><a href="{{ site.baseurl }}/{{ item.slug }}/{{ subcategory.subslug }}/">{{ subcategory.subtitle }}</a></li>
19-
{% endfor %}
20-
</ul>
21-
15+
<a href="{{ site.baseurl }}/{{ item.slug }}/">{{ item.title }}</a>
2216
{% endif %}
2317

24-
18+
<ul>
19+
{% for subcategory in item.subitems %}
20+
<li{% if current_page.last == subcategory.subslug %} class='active'{% endif %}><a href="{{ site.baseurl }}/{{ item.slug }}/{{ subcategory.subslug }}/">{{ subcategory.subtitle }}</a></li>
21+
{% endfor %}
22+
</ul>
2523

2624

2725
{% else %}
2826

29-
<li{% if current_page.last == item.slug %} class='active'{% endif %}>
30-
<a href="{{ site.baseurl }}/{{ item.slug }}">{{ item.title }}</a>
31-
{% endif %}
32-
</li>
27+
<li{% if current_page.last == item.slug %} class='active'{% endif %}>
28+
{% if item.url != null %}
29+
<a href="{{ item.url }}/">{{ item.title }}</a>
30+
{% else %}
31+
<a href="{{ site.baseurl }}/{{ item.slug }}/">{{ item.title }}</a>
32+
{% endif %}
33+
{% endif %}
34+
</li>
35+
36+
3337

3438
{% endfor %}
3539
</ul>

0 commit comments

Comments
 (0)