forked from spinnaker/spinnaker.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnav_list_entries.html
34 lines (29 loc) · 1.06 KB
/
nav_list_entries.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
{% for nav in include.navigation %}
<li {% if nav.collapsed %}class="collapsed"{% endif %} data-depth="{{ include.depth }}">
{% if nav.url %}
{% comment %} internal/external URL check {% endcomment %}
{% if nav.url contains "://" %}
{% assign domain = "" %}
{% else %}
{% assign domain = site.url | append: site.baseurl %}
{% endif %}
{% comment %} set "active" class on current page {% endcomment %}
{% if nav.url == page.url %}
{% assign active = "active" %}
{% else %}
{% assign active = "" %}
{% endif %}
<a href="{{ domain }}{{ nav.url }}" class="{{ active }}">
{% endif %}
<span {% if include.entitle %}class="nav__sub-title"{% endif %}>{{ nav.title }}</span>
{% if nav.url %}
</a>
{% endif %}
{% if nav.children != null %}
<ul {% if include.depth > 1 %}class="nav__items-nested"{% endif %}>
{% assign depth=include.depth | plus:1 %}
{% include nav_list_entries.html navigation=nav.children depth=depth %}
</ul>
{% endif %}
</li>
{% endfor %}