-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathnav.html
57 lines (55 loc) · 1.82 KB
/
nav.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<ul class="nav-list">
{% if page.sidebar == "core" %}
{% assign navlist = site.data.navcore %}
{% elsif page.sidebar == "sql" %}
{% assign navlist = site.data.navsql %}
{% else %}
{% assign navlist = site.data.nav %}
{% endif %}
{% for nav in navlist %}
{% if nav.subcategories != null %}
{% assign current_parent = nav.subcategories | where:"page", page.path | size %}
{% if current_parent != 0 %}
{% assign classlist = "active" %}
{% else %}
{% assign classlist = "" %}
{% endif %}
<li class="nav-list-item {{classlist}}">
<a href="#"
class="nav-list-expander"><svg viewBox="0 0 24 24">
<use xlink:href="#svg-arrow-right"></use>
</svg></a>
{% if nav.page %}
<a class="nav-list-link"
href="{% link {{ nav.page }} %}">{{ nav.title }}</a>
{% else %}
<a class="nav-list-link"
href="#">{{ nav.title }}</a>
{% endif %}
<ul class="nav-list ">
{% for subcategory in nav.subcategories %}
{% if page.path == subcategory.page %}
{% assign classlist = "active" %}
{% else %}
{% assign classlist = "" %}
{% endif %}
<li class="nav-list-item">
<a class="nav-list-link {{ classlist }}"
href="{% link {{ subcategory.page }} %}">{{ subcategory.subtitle }}</a>
</li>
{% endfor %}
</ul>
</li>
{% else %}
{% if page.path == nav.page %}
{% assign classlist = "active" %}
{% else %}
{% assign classlist = "" %}
{% endif %}
<li class="nav-list-item">
<a class="nav-list-link {{classlist}}"
href="{% link {{ nav.page }} %}">{{ nav.title }}</a>
</li>
{% endif %}
{% endfor %}
</ul>