{{"<!-- Nav Bar -->" | safeHTML }}
<section id="navigation" class="sticky-top navigation border-glow">
    <div class="container">
        <nav class="navbar navbar-expand-lg navbar-dark">
            <a class="navbar-brand p-0" href="{{ .Site.BaseURL | relLangURL }}">
                {{ if site.Params.logo }}
                <img class="lozad" src="{{ site.Params.logo | absURL }}" alt="{{ .Site.Title }}" height="48">
                {{ else }}
                {{ site.Title }}
                {{ end }}
            </a>

            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navigation-bs-collapse">
                <span class="navbar-toggler-icon"></span>
            </button>
                
            <div class="collapse navbar-collapse justify-content-end" id="navigation-bs-collapse">
                <ul class="navbar-nav">
                    {{ range site.Menus.main }}
                    <li class="nav-item">
                        <a class="nav-link" href="{{if .Pre}}{{if not $.IsHome}}{{site.BaseURL | relLangURL}}{{end}}{{.Pre}}{{ .URL }}{{else}}{{.URL | relLangURL}}{{end}}">{{ .Name }}</a>
                    </li>
                    {{ end }}

                    {{ if site.Menus.more }}
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                            More
                        </a>
                        <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdownMenuLink">
                            {{ range site.Menus.more }}
                            <a class="dropdown-item" href="{{if .Pre}}{{if not $.IsHome}}{{site.BaseURL | relLangURL}}{{end}}{{.Pre}}{{ .URL }}{{else}}{{.URL | relLangURL}}{{end}}">{{ .Name }}</a>
                            {{ end }}
                        </ul>
                    </li>   
                    {{ end }}
                </ul>

                {{- if hugo.IsMultilingual }}
                <select id="select-language" onchange="location = this.value;">
                    {{ $siteLanguages := site.Languages }}
                    {{ $pageLang := .Page.Lang}}
					{{ range .Page.AllTranslations }}
					{{ $translation := .}}
					{{ range $siteLanguages }}
					{{ if eq $translation.Lang .Lang }}
					{{ $selected := false }}
					{{ if eq $pageLang .Lang}}
					<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}" selected>{{ .LanguageName }}
					</option>
					{{ else }}
					<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}">{{ .LanguageName }}</option>
					{{ end }}
					{{ end }}
					{{ end }}
					{{ end }}
                </select>
                {{ end }}
            </div>
        </nav>
    </div>
</section>
{{"<!-- /Nav Bar -->" | safeHTML }}