omegamma/layouts/partials/header.html

69 lines
2.8 KiB
HTML
Raw Normal View History

{{ $white := .Params.HeaderTextWhite }}
2021-06-23 01:18:18 +00:00
<nav class="{{ if $white }}text-white{{ end }}">
2021-06-08 14:19:46 +00:00
<div class="center nav-flex">
{{ $currentPage := . }}
<div class="nav-mobile">
2021-06-08 16:18:22 +00:00
<a class="navbar-brand" href="{{ .Site.Params.brandWebsite }}" role="button">
<img src="/img/icon.png" loading=lazy class="icon-brand" alt="Ad5001's icon"/>
2021-06-08 16:18:22 +00:00
Ad5001
2021-06-08 14:19:46 +00:00
</a>
<button id="navbar-toggler" aria-label="Show menu" class="{{ if $white }}text-white{{ end }}">
<i class="icon-menu icon-larger2-text" alt="Menu icon"></i>
2021-06-08 14:19:46 +00:00
</button>
</div>
2021-06-23 01:18:18 +00:00
<div class="navbar-menu">
2021-06-08 14:19:46 +00:00
<ul class="navbar-list">
{{ range .Site.Menus.main.ByWeight }}
2021-06-08 14:19:46 +00:00
{{ if .HasChildren }}
<li class="menu-with-sub">
<li class="{{ if $currentPage.HasMenuCurrent "main" . }}active{{ end }}">
<a href="#" role="button">
2021-06-08 14:19:46 +00:00
{{ .Pre }}
<span>{{ .Name }}</span>
</a>
</li>
2021-06-08 14:19:46 +00:00
<ul class="sub-menu">
{{ range .Children }}
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }} background">
<a href="{{ .URL }}" role="button">
2021-06-08 14:19:46 +00:00
{{ .Name }}
</a>
</li>
2021-06-08 14:19:46 +00:00
{{ end }}
</ul>
</li>
2021-06-08 14:19:46 +00:00
{{ else }}
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
<a href="{{ .URL }}" role="button">
{{ .Pre }}
<span>{{ .Name }}</span>
</a>
</li>
{{ end }}
{{ end }}
{{ $currentLang := .Site.Language }}
{{ if .IsTranslated }}
<li class="menu-with-sub">
<a href="#" role="button">
<i class="icon-lang icon-as-text" alt="{{ i18n "language" }} language flag"></i>
<span>{{ i18n "language" }}</span>
2021-06-08 14:19:46 +00:00
</a>
2021-06-23 01:18:18 +00:00
<ul class="sub-menu center">
{{ range .Translations }}
<li class="background">
<a href="{{ .Permalink }}" role="button">
<img src="/icons/flag/{{ .Language.Lang }}.svg" class="icon-as-text"/>
{{ .Language.LanguageName }}
</a>
</li>
{{ end }}
</ul>
</li>
2021-06-08 14:19:46 +00:00
{{ end }}
</ul>
</div>
</div>
</nav>