{{ 'navigation' | t: 'title' }}
{%- assign current_url = page.url | remove: 'index.html' %}
{%- assign previous = null %}
{%- assign regex = '/' | append: site.paginate_page | append: '[0-9]/' %}
{%- assign main_pages = site.pages | where: 'nav-level', '1' | sort: 'nav-order' -%}
{% for item in main_pages %}
{%- assign current = item.nav-title | default: item.title %}
{%- if (current != previous) %}
{%- assign previous = item.nav-title | default: item.title %}
{%- assign parent_perma = item.permalink %}
{%- assign parent_perma_size = parent_perma | size %}
{%- assign sub_pages = '' | split: '' %}
{%- for p in site.pages %}
{%- assign child_perma = p.permalink %}
{%- assign child_perma_truncated = child_perma | truncate: parent_perma_size, '' %}
{%- if parent_perma != '/' and child_perma_truncated == parent_perma and child_perma != parent_perma %}
{%- assign sub_pages = sub_pages | push: p %}
{%- endif %}
{%- endfor %}
- 0 %} class="has-children"{% endif %}>
{%- assign item_url = item.url | regex_replace: regex,'/' | prepend: site.baseurl %}
{%- if sub_pages.size > 0 %}
{{ item.nav-section | default: item.nav-title | default: item.title }}
{%- else %}
{{ item.nav-title | default: item.title }}
{%- endif -%}
{% if sub_pages.size > 0 %}
{%- endif %}
{%- endif %}
{%- endfor %}