Rinkusu/layouts/partials/navigation.html

63 lines
2.9 KiB
HTML
Raw Permalink Normal View History

2021-05-27 11:57:11 +02:00
{{"<!-- Nav Bar -->" | safeHTML }}
2024-09-15 21:49:35 +02:00
<section id="navigation" class="sticky-top navigation border-glow">
2021-05-27 11:57:11 +02:00
<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>
2024-09-15 21:49:35 +02:00
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navigation-bs-collapse">
2021-05-27 11:57:11 +02:00
<span class="navbar-toggler-icon"></span>
</button>
2024-09-15 21:49:35 +02:00
<div class="collapse navbar-collapse justify-content-end" id="navigation-bs-collapse">
2022-02-18 10:00:30 +01:00
<ul class="navbar-nav">
2021-05-27 11:57:11 +02:00
{{ 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 }}
2021-10-04 09:13:42 +02:00
2021-10-26 11:40:24 +02:00
{{ if site.Menus.more }}
2021-10-04 09:13:42 +02:00
<li class="nav-item dropdown">
2022-02-18 10:00:30 +01:00
<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">
2021-10-26 11:40:24 +02:00
{{ 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 }}
2022-02-18 10:00:30 +01:00
</ul>
2021-10-26 11:40:24 +02:00
</li>
{{ end }}
2021-05-27 11:57:11 +02:00
</ul>
{{- if hugo.IsMultilingual }}
2021-05-27 11:57:11 +02: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}}
<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 }}