2016-03-25 19:12:03 +01:00
|
|
|
{% include base_path %}
|
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 %}
|
|
|
|
{% comment %}internal/external URL check{% endcomment %}
|
|
|
|
{% if nav.url contains "http" %}
|
|
|
|
{% assign domain = "" %}
|
|
|
|
{% else %}
|
|
|
|
{% assign domain = base_path %}
|
|
|
|
{% 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-04-18 22:22:53 +02:00
|
|
|
{% comment %}internal/external URL check{% endcomment %}
|
|
|
|
{% if child.url contains "http" %}
|
|
|
|
{% assign domain = "" %}
|
|
|
|
{% else %}
|
|
|
|
{% assign domain = base_path %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% comment %}set "active" class on current page{% endcomment %}
|
|
|
|
{% 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-04-18 22:22:53 +02:00
|
|
|
</nav>
|
|
|
|
|
|
|
|
|