Hugo theme for ad5001.eu and related websites
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

69 lines
2.7 KiB

<nav>
<div class="center nav-flex">
{{ $currentPage := . }}
<div class="nav-mobile">
<a class="navbar-brand" href="{{ .Site.Params.brandWebsite }}" role="button">
<img src="/img/icon.png" class="icon-brand" alt=""/>
Ad5001
</a>
<button id="navbar-toggler">
<img src="/icons/menu.svg" class=""/>
</button>
</div>
<div class="navbar-menu">
<ul class="navbar-list">
{{ range .Site.Menus.main }}
{{ if .HasChildren }}
<div class="menu-with-sub">
<a href="#" role="button">
<li class="{{ if $currentPage.HasMenuCurrent "main" . }}active{{ end }}">
{{ .Pre }}
<span>{{ .Name }}</span>
</li>
</a>
<ul class="sub-menu">
{{ range .Children }}
<a href="{{ .URL }}" role="button">
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }} background">
{{ .Name }}
</li>
</a>
{{ end }}
</ul>
</div>
{{ else }}
<a href="{{ .URL }}" role="button">
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
{{ .Pre }}
<span>{{ .Name }}</span>
</li>
</a>
{{ end }}
{{ end }}
{{ $currentLang := .Site.Language }}
{{ if .IsTranslated }}
<div class="menu-with-sub">
<a href="#" role="button">
<li>
<img src="/icons/lang.svg" class="icon-as-text"/>
<span>{{ i18n "language" }}</span>
</li>
</a>
<ul class="sub-menu">
{{ range .Translations }}
<a href="{{ .Permalink }}" role="button">
<li class="background">
<img src="/icons/flag/{{ .Language.Lang }}.svg" class="icon-as-text"/>
{{ .Language.LanguageName }}
</li>
</a>
{{ end }}
</ul>
</div>
{{ end }}
</ul>
</div>
</div>
</nav>