2016-10-30 01:02:14 +02:00
|
|
|
{% assign navigation = site.data.navigation[include.nav] %}
|
|
|
|
|
|
|
|
<nav class="nav__list">
|
2016-11-23 02:29:35 +01:00
|
|
|
{% if page.sidebar.title %}<h3 class="nav__title" style="padding-left: 0;">{{ page.sidebar.title }}</h3>{% endif %}
|
|
|
|
<input id="ac-toc" name="accordion-toc" type="checkbox" />
|
|
|
|
<label for="ac-toc">{{ site.data.ui-text[site.locale].menu_label | default: "Toggle Menu" }}</label>
|
|
|
|
<ul class="nav__items">
|
2016-10-30 01:02:14 +02:00
|
|
|
{% for nav in navigation %}
|
|
|
|
<li>
|
|
|
|
{% if nav.url %}
|
2016-11-23 02:29:35 +01:00
|
|
|
{% comment %} internal/external URL check {% endcomment %}
|
2016-10-30 01:02:14 +02:00
|
|
|
{% if nav.url contains "://" %}
|
|
|
|
{% assign domain = "" %}
|
|
|
|
{% else %}
|
2016-11-23 02:29:35 +01:00
|
|
|
{% assign domain = site.url | append: site.baseurl %}
|
2016-10-30 01:02:14 +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 %}
|
|
|
|
|
|
|
|
{% if nav.children != null %}
|
|
|
|
<ul>
|
|
|
|
{% for child in nav.children %}
|
2016-11-23 02:29:35 +01:00
|
|
|
{% comment %} internal/external URL check {% endcomment %}
|
2016-10-30 01:02:14 +02:00
|
|
|
{% if child.url contains "://" %}
|
|
|
|
{% assign domain = "" %}
|
|
|
|
{% else %}
|
2016-11-23 02:29:35 +01:00
|
|
|
{% assign domain = site.url | append: site.baseurl %}
|
2016-10-30 01:02:14 +02:00
|
|
|
{% endif %}
|
|
|
|
|
2016-11-23 02:29:35 +01:00
|
|
|
{% comment %} set "active" class on current page {% endcomment %}
|
2016-10-30 01:02:14 +02:00
|
|
|
{% if child.url == page.url %}
|
|
|
|
{% assign active = "active" %}
|
|
|
|
{% else %}
|
|
|
|
{% assign active = "" %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<li><a href="{{ domain }}{{ child.url }}" class="{{ active }}">{{ child.title }}</a></li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% endif %}
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
2016-11-23 02:29:35 +01:00
|
|
|
</nav>
|