omegamma/layouts/partials/header.html

90 lines
3.8 KiB
HTML
Raw Permalink Normal View History

2021-12-30 22:58:11 +00:00
<!--
Omegamma - Hugo theme for ad5001.eu and related websites
Copyright (C) 2021-2022 Ad5001 <mail@ad5001.eu>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
{{ $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>
2021-09-30 20:51:20 +00:00
<span class="mobile-label">{{ 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">
{{ index site.Data.flags .Language.Lang }} {{ .Language.LanguageName }}
</a>
</li>
{{ end }}
</ul>
</li>
2021-06-08 14:19:46 +00:00
{{ end }}
</ul>
</div>
</div>
</nav>