<nav class="menu">
    <ul class="menu__inner">
        {{- $currentPage := . -}}
        {{ range sort .Site.Menus.main ".Identifier" -}}
            {{ if .HasChildren }}
                <div class="submenu">
                    <li class="dropdown">
                    <a href="javascript:void(0)" class="dropbtn">{{ .Name }}</a>
                    <div class="dropdown-content">
                    {{ range .Children }}
                        <a href="{{ .URL }}">{{ .Name }}</a>
                    {{ end }}
                    </div>
                    </li>
                </div>
            {{ else }}
                <li><a href="{{ .URL | relLangURL }}">{{ .Name }}</a></li>
            {{ end }}
        {{- end }}

        {{- if .Site.Params.EnableGlobalLanguageMenu }}
        <ul class="submenu">
            <li class="dropdown">
                <a href="javascript:void(0)" class="dropbtn">{{ .Language }}</a>
                <div class="dropdown-content">
                    {{- if hugo.IsMultilingual }}
                        {{ range $.Translations }}
                            <a title="{{ .Language }}" href="{{ .Permalink }}">{{ .Language }}</a>
                        {{ end }}
                    {{- end }}
                </div>
            </li>
        </ul>
        {{- end }}
    </ul>
</nav>

