<nav class="navbar navbar-expand navbar-dark flex-column flex-md-row td-navbar my-lg-10">
  <a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}">
		<span class="navbar-logo">{{ if .Site.Params.ui.navbar_logo }}{{ with resources.Get "icons/logo.svg" }}{{ ( . | minify).Content | safeHTML }}{{ end }}{{ end }}</span><span>{{ .Site.Title }}</span>
	</a>

	<ul class="navbar-nav">
		{{ $p := . }}
		{{ range .Site.Menus.main }}
			{{ $active := or ($p.IsMenuCurrent "main" .) ($p.HasMenuCurrent "main" .) }}
			{{ with .Page }}
			{{ $active = or $active ( $.IsDescendant .)  }}
			{{ end }}
			{{ $url := urls.Parse .URL }}
			{{ $baseurl := urls.Parse $.Site.Params.Baseurl }}
			{{ if .HasChildren }}
				<li class="nav-item dropdown">
					<a class="nav-link {{if $active }} active{{end}} dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
						{{ .Name }}
					</a>
					<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownMenuLink">
						{{ range .Children  }}
						{{ $childrenurl := urls.Parse .URL }}
						<a class="dropdown-item" href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}" {{ if ne $childrenurl.Host $baseurl.Host }}target="_blank" {{ end }}>{{ .Name }}</a>
						{{ end }}
					</div>
				</li>
			{{ else }}
				<li class="nav-item">
					<a class="nav-link{{if $active }} active{{end}}" href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}" {{ if ne $url.Host $baseurl.Host }}target="_blank" {{ end }}><span{{if $active }} class="active"{{end}}>{{ .Name }}</span></a>
				</li>
			{{ end }}
		{{ end }}
		<li class="nav-item nav-search-item">{{ partial "search-input.html" . }}</li>
	</ul>
</nav>
