Sha256: 287d3d74a47163b9ba213e1f08c57f5e256e4a9f8a481ab61f1b986da6d742ad

Contents?: true

Size: 1.78 KB

Versions: 3

Compression:

Stored size: 1.78 KB

Contents

{%- comment -%}
  Include vars:
  section_items
{%- endcomment -%}

<!-- Nav -->
<nav id="nav">
  <ul>
    {%- assign _pages = site.html_pages | where_exp: "page", "page.hide != true" -%}
    {%- unless _pages == null -%}
      {%- assign _pages = _pages | sort: 'order' -%}
      {%- for _page in _pages -%}
        {%- assign _title = _page.title | default: _page.layout -%}
        {%- assign _slug = _title | slugify -%}
        {%- assign _icon = _page.icon | default: 'fa-link' -%}
        {%- comment -%}<!-- page.url (no underscore) is the url of the current page-->{%- endcomment -%}
        {%- if _page.url == page.url -%}
          <li><a href="#" id="{{- _slug -}}" class="active">
            <span class="icon {{ _icon }}">{{- _title -}}</span>
          </a></li>
        {%- elsif _page.url -%}
          <li><a href="{{- _page.url | absolute_url -}}" id="{{- _slug -}}-link">
            <span class="icon {{ _icon }}">{{- _title -}}</span>
          </a></li>
        {%- else -%}
          <li><a href="{{- '/' | absolute_url -}}" id="broken-link"><span class="icon fa-unlink">[broken link]</span></a></li>
        {%- endif -%}
      {%- endfor -%}
    {%- endunless -%}
    {%- assign _sections = include.section_items | where_exp: "section", "section.hide != true" -%}
    {%- if _pages[0] and _sections[0] -%}<hr>{%- endif -%}
    {%- unless _sections == null -%}
      {%- for _sect in _sections -%}
        {%- assign _title = _sect.title | default: _sect.layout | default: 'Untitled' -%}
        {%- assign _slug = _title | slugify -%}
        {%- assign _icon = _sect.icon | default: 'fa-file' -%}
        <li><a href="#{{- _slug -}}" id="{{- _slug -}}-link" class="scrolly"><span class="icon {{ _icon }}">{{- _title -}}</span></a></li>
      {%- endfor -%}
    {%- endunless -%}
  </ul>
</nav>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jekyll-theme-prologue-0.3.2 _includes/nav.html
jekyll-theme-prologue-0.3.1 _includes/nav.html
jekyll-theme-prologue-0.3.0 _includes/nav.html