 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