aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/_includes/common/navbar.html
blob: a255619cce809714a3749b109d852c618fbc4d5d (plain) (blame)
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
<nav class="navbar navbar-default navbar-static-top">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="/">{{ site.settings.author.name }}</a>
    </div>
    <div class="navbar-collapse collapse">
      <ul class="nav navbar-nav">
        {% assign page_list = site.pages | where_exp: "x","x.navbar_link" | sort: "navbar_priority" %}
        {% for node in page_list %}
          {% if node.navbar_paginated %}
            {% if navbar_has_paginated %}
              {% continue %}
            {% endif %}
            {% assign navbar_has_paginated = true %}
          {% endif %}
          {% assign link = node.navbar_link %}
          {% if link == true %}
            {% assign link = node.title %}
          {% endif %}
          {% if page.url == node.url %}
            <li class="active"><a href="{{ node.url | relative_url }}" class="active">{{ link }}</a></li>
          {% else %}
            <li><a href="{{ node.url | relative_url }}">{{ link }}</a></li>
          {% endif %}
        {% endfor %}
      </ul>
    </div>
  </div>
</nav>