forked from yousinix/portfolYOU
-
Notifications
You must be signed in to change notification settings - Fork 0
/
navbar.html
62 lines (44 loc) · 2.07 KB
/
navbar.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
58
59
60
61
62
<nav class="navbar navbar-expand-lg navbar-themed">
<a class="navbar-brand" href="{{ site.baseurl }}/"><h5><b>{{ site.title }}</b></h5></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<i class="fas fa-1x fa-bars text-themed"></i>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav ml-auto">
{%- assign html_pages = site.html_pages | sort: 'weight' -%}
{%- assign filtered_pages = "" | split: "" -%}
{%- for html_page in html_pages -%}
{%- assign exclude = false -%}
{%- for exclude_path in site.nav_exclude -%}
{%- if exclude_path == html_page.path -%}
{%- assign exclude = true -%}
{%- break -%}
{%- elsif exclude_path contains '**' -%}
{%- assign match = exclude_path | remove: '**' -%}
{%- if html_page.path contains match -%}
{%- assign exclude = true -%}
{%- break -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- unless exclude -%}
{%- assign filtered_pages = filtered_pages | push: html_page -%}
{%- endunless -%}
{%- endfor -%}
{% for html_page in filtered_pages %}
{%- if page.url contains html_page.url -%}
{%- assign active_status = "active" -%}
{%- else -%}
{%- assign active_status = "" -%}
{%- endif -%}
{%- if html_page.external_url -%}
{%- assign url = html_page.external_url -%}
{%- else -%}
{%- assign url = html_page.url | relative_url -%}
{%- endif -%}
<a class="nav-item nav-link {{ active_status }}" href="{{ url }}" {%- if html_page.external_url and site.open_new_tab -%} target="_blank" {%- endif -%}>{{ html_page.title }}</a>
{% endfor %}
<span id="theme-toggler" class="nav-item nav-link" role="button" onclick="toggleTheme()"></span>
</div>
</div>
</nav>