speedtech-website/themes/lean/layouts/partials/nav.html

51 lines
1.7 KiB
HTML
Raw Normal View History

<nav id="topnav">
2024-10-04 11:58:15 +02:00
<div class="container">
<a class="navbar-brand" href="/{{ cond (eq (.Site.Language.Lang) "it") "" .Site.Language.Lang}}">
2024-10-04 11:58:15 +02:00
<img class="img-fluid" src="/img/logo.svg" alt="SpeedTech">
</a>
<div id="topmenu">
2025-05-14 18:03:13 +02:00
<button id="responsive-button" onclick="htmx.toggleClass(htmx.find('#topmenu'), 'responsive')"><i class="icon icon-menu"></i></button>
<ul>
2024-10-04 11:58:15 +02:00
{{ $current := . }}
{{ range .Site.Menus.main }}
{{ $topLevel := replace .URL "/" "" }}
{{ if .HasChildren }}
2025-05-11 20:54:29 +02:00
<li class="dropdown">
<a href="{{ .URL }}" role="button">
2024-10-04 11:58:15 +02:00
{{ .Name }}
</a>
2025-05-11 20:54:29 +02:00
<ul class="submenu">
2024-10-04 11:58:15 +02:00
{{ range .Children }}
<li>
<a href="{{ .URL }}" title="{{ .Params.title }}">
2024-10-04 11:58:15 +02:00
{{with .Params.iconclass}}
<i class="{{ . }}"></i>
{{end}}
{{ .Name }}
</a>
</li>
{{ end }}
</ul>
</li>
{{ else }}
<li class="{{ if eq $current.RelPermalink .URL | or (eq $current.Type $topLevel) | or (and (eq (default (trim .URL "/") .Identifier) "blog") (in (slice "taxonomy" "taxonomyTerm") $current.Kind)) }} active{{ end }}">
<a href="{{ .URL }}">{{ .Name }}</a>
2024-10-04 11:58:15 +02:00
</li>
{{ end }}
{{ end }}
{{ if .IsTranslated }}
{{ range .Translations }}
<li>
<a href="{{ .Permalink }}" >{{ upper .Lang }} {{ if .IsPage }} {{ end }} </a>
2024-10-04 11:58:15 +02:00
</li>
{{ end}}
{{ end }}
</ul>
</div>
</div>
</nav>
<!-- *** NAVBAR END ***-->