-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathheader.html
43 lines (36 loc) · 1.5 KB
/
header.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<header class="site-header">
<div class="wrapper">
<a href="{{ "/" | prepend: site.baseurl }}" class="logo">
<img src="{{ "/img/openbudgets-logo.svg" | prepend: site.baseurl }}" alt="OpenBudgets">
</a>
{% assign current_page = page.url | downcase | split: '/' %}
<nav>
<ul>
{% for item in site.data.menu %}
{% if item.subitems != null %}
<li class="{% if current_page.last == item.slug %} active{% endif %}{% if item.subitems != null %} has-children{% endif %}">
{% if item.url != null %}
<a href="{{ item.url }}/">{{ item.title }}</a>
{% else %}
<a href="{{ site.baseurl }}/{{ item.slug }}/">{{ item.title }}</a>
{% endif %}
<ul>
{% for subcategory in item.subitems %}
<li{% if current_page.last == subcategory.subslug %} class='active'{% endif %}><a href="{{ site.baseurl }}/{{ item.slug }}/{{ subcategory.subslug }}/">{{ subcategory.subtitle }}</a></li>
{% endfor %}
</ul>
{% else %}
<li{% if current_page.last == item.slug %} class='active'{% endif %}>
{% if item.url != null %}
<a href="{{ item.url }}/">{{ item.title }}</a>
{% else %}
<a href="{{ site.baseurl }}/{{ item.slug }}/">{{ item.title }}</a>
{% endif %}
{% endif %}
</li>
{% endfor %}
</ul>
</nav>
</div>
<a id="cd-menu-trigger" href="#0"><span class="cd-menu-text">Menu</span><span class="cd-menu-icon"></span></a>
</header>