jrgnsn.net/_includes/navigation.html -rw-r--r-- 884 bytes View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{%- assign default_paths = site.pages | map: "path" -%}
{%- assign page_paths = site.header_pages | default: default_paths -%}
{%- if page_paths -%}
  <div class="navigation">
    <ul class="nav" role="menu">
      <li class="nav-home{% if page.url == '/' %} nav-current{% endif %}"><a href="/">Home</a></li>
      {%- for path in page_paths -%}
        {%- assign my_page = site.pages | where: "path", path | first -%}
        {%- if my_page.title -%}
          {%- unless my_page.enableMenu == false -%}
          <li class="nav-{{ my_page.title | slugify }}{% if page.url == my_page.url %} nav-current{% endif %}" role="menuitem">
          <a class="page-link" href="{{ my_page.url | relative_url }}">
          {{  | my_page.title | escape }}
          </a>
          </li>
            {%- endunless -%}
        {%- endif -%}
      {%- endfor -%}
    </ul>
  </div>
{%- endif -%}