forked from nicolas-van/bootstrap-4-github-pages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.html
30 lines (29 loc) · 1.31 KB
/
header.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
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<div class="container">
<a class="navbar-brand" rel="author" href="{{ "/" | relative_url }}">{{ site.title | escape }}</a>
{%- assign page_paths = site.header_pages -%}
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
{%- for path in page_paths -%}
{%- assign my_page = site.pages | where: "path", path | first -%}
{%- if my_page.title -%}
<li class="nav-item">
{%- if my_page.redirect -%}
<a class="nav-link" href="{{ my_page.redirect }}">{{ my_page.title | escape }}</a>
{%- else -%}
<a class="nav-link" href="{{ my_page.url | relative_url }}">{{ my_page.title | escape }}</a>
{%- endif -%}
</li>
{%- endif -%}
{% endfor -%}
<!-- li class="nav-item">
<a class="nav-link" href="{{ site.github.repository_url }}">Fork me on Github</a>
</li -->
</ul>
</div>
</div>
</nav>