2016-04-18 22:22:53 +02:00
|
|
|
{% assign navigation = site.data.navigation[include.nav] %}
|
2016-03-25 19:12:03 +01:00
|
|
|
|
2016-03-25 19:50:59 +01:00
|
|
|
<nav class="nav__list">
|
2016-04-12 18:04:16 +02:00
|
|
|
{% if page.sidebar.title %}<header><h4 class="nav__title" style="padding: 0;">{{ page.sidebar.title }}</h4></header>{% endif %}
|
2016-03-25 19:12:03 +01:00
|
|
|
<ul>
|
|
|
|
{% for nav in navigation %}
|
2016-04-18 22:22:53 +02:00
|
|
|
<li>
|
|
|
|
{% if nav.url %}
|
2016-10-06 21:40:30 +02:00
|
|
|
{% comment %} internal/external URL check {% endcomment %}
|
2016-06-03 17:59:19 +02:00
|
|
|
{% if nav.url contains "://" %}
|
2016-04-18 22:22:53 +02:00
|
|
|
{% assign domain = "" %}
|
|
|
|
{% else %}
|
2016-10-06 21:40:30 +02:00
|
|
|
{% assign domain = site.url | append: site.baseurl %}
|
2016-04-18 22:22:53 +02:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<a href="{{ domain }}{{ nav.url }}"><span class="nav__sub-title">{{ nav.title }}</span></a>
|
|
|
|
{% else %}
|
|
|
|
<span class="nav__sub-title">{{ nav.title }}</span>
|
|
|
|
{% endif %}
|
|
|
|
|
2016-03-25 19:12:03 +01:00
|
|
|
{% if nav.children != null %}
|
|
|
|
<ul>
|
|
|
|
{% for child in nav.children %}
|
2016-10-06 21:40:30 +02:00
|
|
|
{% comment %} internal/external URL check {% endcomment %}
|
2016-06-03 17:59:19 +02:00
|
|
|
{% if child.url contains "://" %}
|
2016-04-18 22:22:53 +02:00
|
|
|
{% assign domain = "" %}
|
|
|
|
{% else %}
|
2016-10-06 21:40:30 +02:00
|
|
|
{% assign domain = site.url | append: site.baseurl %}
|
2016-04-18 22:22:53 +02:00
|
|
|
{% endif %}
|
|
|
|
|
2016-10-06 21:40:30 +02:00
|
|
|
{% comment %} set "active" class on current page {% endcomment %}
|
2016-04-18 22:22:53 +02:00
|
|
|
{% if child.url == page.url %}
|
2016-03-25 19:50:59 +01:00
|
|
|
{% assign active = "active" %}
|
2016-03-25 19:12:03 +01:00
|
|
|
{% else %}
|
2016-03-25 19:50:59 +01:00
|
|
|
{% assign active = "" %}
|
2016-03-25 19:12:03 +01:00
|
|
|
{% endif %}
|
2016-04-18 22:22:53 +02:00
|
|
|
|
|
|
|
<li><a href="{{ domain }}{{ child.url }}" class="{{ active }}">{{ child.title }}</a></li>
|
2016-03-25 19:12:03 +01:00
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% endif %}
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
2016-06-03 17:59:19 +02:00
|
|
|
</nav>
|