2020-01-25 07:04:33 +00:00
|
|
|
<nav class="navbar navbar-expand-md navbar-dark">
|
2019-11-18 05:24:27 +00:00
|
|
|
<a class="navbar-brand" href="{{ .Site.BaseURL | relLangURL }}">
|
2019-10-10 09:25:24 +00:00
|
|
|
{{ $logo:= .Site.Params.logo }}
|
2020-01-08 10:41:37 +00:00
|
|
|
{{ $logoWhite:= .Site.Params.logo_white }}
|
|
|
|
{{ if (or $logo $logoWhite) }}
|
2019-10-10 09:25:24 +00:00
|
|
|
{{ if .IsHome }}
|
2020-01-08 10:41:37 +00:00
|
|
|
<img class="img-fluid" src="{{if $logoWhite }}{{ $logoWhite | absURL }} {{ else }} {{ $logo | absURL }}{{ end }}" alt="{{ .Site.Title }}">
|
2019-10-10 09:25:24 +00:00
|
|
|
{{ else }}
|
|
|
|
<img class="img-fluid" src="{{ $logo | absURL }}" alt="{{ .Site.Title }}">
|
|
|
|
{{ end }}
|
2020-01-08 10:41:37 +00:00
|
|
|
{{ else }}
|
|
|
|
{{ .Site.Title }}
|
2019-10-10 09:25:24 +00:00
|
|
|
{{ end }}
|
|
|
|
</a>
|
2019-03-13 05:20:07 +00:00
|
|
|
<button class="navbar-toggler border-0" type="button" data-toggle="collapse" data-target="#navigation"
|
|
|
|
aria-controls="navigation" aria-expanded="false" aria-label="Toggle navigation">
|
|
|
|
<span class="navbar-toggler-icon"></span>
|
|
|
|
</button>
|
2019-01-06 10:40:05 +00:00
|
|
|
|
2019-03-13 05:20:07 +00:00
|
|
|
<div class="collapse navbar-collapse text-center" id="navigation">
|
|
|
|
<ul class="navbar-nav ml-auto">
|
|
|
|
<li class="nav-item">
|
2019-06-08 22:35:16 +00:00
|
|
|
<a class="nav-link text-dark" href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Params.home }}</a>
|
2019-03-13 05:20:07 +00:00
|
|
|
</li>
|
|
|
|
{{ range .Site.Menus.main }}
|
|
|
|
{{ if .HasChildren }}
|
|
|
|
<li class="nav-item dropdown">
|
|
|
|
<a class="nav-link dropdown-toggle text-dark" href="#" role="button" data-toggle="dropdown" aria-haspopup="true"
|
|
|
|
aria-expanded="false">
|
|
|
|
{{ .Name }}
|
|
|
|
</a>
|
2020-01-08 10:41:37 +00:00
|
|
|
<div class="dropdown-menu">
|
2019-03-13 05:20:07 +00:00
|
|
|
{{ range .Children }}
|
2019-06-08 22:35:16 +00:00
|
|
|
<a class="dropdown-item" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
|
2019-03-13 05:20:07 +00:00
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
{{ else }}
|
|
|
|
<li class="nav-item">
|
2020-01-08 10:41:37 +00:00
|
|
|
<a class="nav-link text-dark" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
|
2019-03-13 05:20:07 +00:00
|
|
|
</li>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
</ul>
|
|
|
|
<!-- Language List -->
|
2019-11-18 05:24:27 +00:00
|
|
|
{{- if .Site.IsMultiLingual }}
|
2019-08-22 06:39:33 +00:00
|
|
|
<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}}
|
2020-01-01 07:11:29 +00:00
|
|
|
<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}" selected>{{ .LanguageName }}
|
2019-08-22 06:39:33 +00:00
|
|
|
</option>
|
|
|
|
{{ else }}
|
2020-01-01 07:11:29 +00:00
|
|
|
<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}">{{ .LanguageName }}</option>
|
2019-03-13 05:20:07 +00:00
|
|
|
{{ end }}
|
2019-08-22 06:39:33 +00:00
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
</select>
|
2019-10-21 09:43:01 +00:00
|
|
|
{{ end }}
|
2019-03-13 05:20:07 +00:00
|
|
|
</div>
|
|
|
|
</nav>
|