{{ if eq .Site.Params.permanentTopNav true}}
<nav class="permanentTopNav">
{{ else }}
<nav>
{{ end }}
    <div class="container">
        <ul class="topnav">
            {{ range where (where .Site.Pages.ByWeight ".Type" "page") ".IsPage" true }}
                {{ if .Params.excludeFromTopNav }}
                    {{/* Do nothing */}}
                {{ else if and (isset .Params "link") (ne .Params.link "") }}
                    <li><a href="{{ .Params.link | relURL }}" target="{{ .Params.target }}">{{ .Title }}</a></li>
                {{ else }}
                    <li><a href="{{ .URL }}">{{ .Title }}</a></li>
                {{ end }}
            {{ end }}
        </ul>

        {{ if and (isset .Site.Params "algolia_search") (eq .Site.Params.algolia_search true) }}
            <div id="search-box" class="search">
                <i class="fa fa-search"></i>
                <input id="search" type="text" placeholder="{{ i18n "search" }}">
            </div>
        {{ end }}
    </div>
</nav>
