omegamma/layouts/partials/header.html

72 lines
3.1 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">
{{ if eq .Site.Language.Lang "en" }}
<a class="navbar-brand" href="{{ .Site.Params.brandWebsite }}" role="button">
{{ else }}
<a class="navbar-brand" href="{{ .Site.Params.brandWebsite }}{{ .Site.Language.Lang }}/" role="button">
{{ end }}
<img src="/img/logo.svg" 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" rel="noreferrer">
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" rel="noreferrer">
{{ .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" loading=lazy width=21 height=21/>{{ .Language.LanguageName }}
</a>
</li>
{{ end }}
</ul>
</li>
2021-06-08 14:19:46 +00:00
{{ end }}
</ul>
</div>
</div>
</nav>