{%- assign html_pages = site.html_pages | sort: 'weight' -%}
{%- assign filtered_pages = "" | split: "" -%}
{%- for html_page in html_pages -%}
{%- assign exclude = false -%}
{%- for exclude_path in site.nav_exclude -%}
{%- if exclude_path == html_page.path -%}
{%- assign exclude = true -%}
{%- break -%}
{%- elsif exclude_path contains '**' -%}
{%- assign match = exclude_path | remove: '**' -%}
{%- if html_page.path contains match -%}
{%- assign exclude = true -%}
{%- break -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- unless exclude -%}
{%- assign filtered_pages = filtered_pages | push: html_page -%}
{%- endunless -%}
{%- endfor -%}
{% for html_page in filtered_pages %}
{%- if page.url contains html_page.url -%}
{%- assign active_status = "active" -%}
{%- else -%}
{%- assign active_status = "" -%}
{%- endif -%}
{%- if html_page.external_url -%}
{%- assign url = html_page.external_url -%}
{%- else -%}
{%- assign url = html_page.url | relative_url -%}
{%- endif -%}
{{ html_page.title }}
{% endfor %}