{{ $cover := .HasShortcode "blocks/cover" }}
<nav class="js-navbar-scroll navbar navbar-expand navbar-dark flex-column flex-md-row td-navbar {{ if $cover }}{{else}}navbar-nocover{{end}}">
	<a id="cortex-logo" class="navbar-brand {{ if $cover }}d-none{{end}}" href="{{ .Site.Home.RelPermalink }}">
		<span class="navbar-logo">{{ with resources.Get "icons/logo-white.svg" }}{{ ( . ).Content | safeHTML }}{{ end }}</span>
	</a>
	<div class="td-navbar-nav-scroll ml-md-auto" id="main_navbar">
		<ul class="navbar-nav mt-2 mt-lg-0">
			{{ $p := . }}
			{{ range .Site.Menus.main }}
			<li class="nav-item mr-4 mb-2 mb-lg-0">
				{{ $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 }}
				<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 }}
			{{ if  .Site.Params.versions }}
			<li class="nav-item dropdown d-none d-lg-block">
				{{ partial "navbar-version-selector.html" . }}
			</li>
			{{ end }}
			{{ if  (gt (len .Site.Home.Translations) 0) }}
			<li class="nav-item dropdown d-none d-lg-block">
				{{ partial "navbar-lang-selector.html" . }}
			</li>
			{{ end }}
			<li class="nav-item mr-4 mb-2 mb-lg-0">
				<a href="https://twitter.com/cortexmetrics" class="nav-link active">
					<span class="active"><i class="fab fa-fw fa-twitter"></i> Twitter</span>
				</a>
			</li>
			<li class="nav-item mr-4 mb-2 mb-lg-0">
				<a href="https://github.com/cortexproject" class="nav-link active">
					<span class="active"><i class="fab fa-fw fa-github"></i> Github</span>
				</a>
			</li>
		</ul>
	</div>
	<div class="navbar-nav d-none d-md-block">{{ partial "search-input.html" . }}</div>
</nav>
