53 lines
2.7 KiB
HTML
53 lines
2.7 KiB
HTML
<nav class="navbar" role="navigation" aria-label="main navigation" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
|
|
<div class="navbar__brand">
|
|
{{ if $.Param "logo" | default true }}
|
|
<a href="{{ "/" | relLangURL }}" title="{{ i18n "tooltip-home" }}" rel="home" class="{{ if eq ($.Param "logoType") "long" }}navbar__long-link{{ else }}navbar__logo-link{{ end }}">
|
|
<img src="{{ "/logo.png" | relURL }}" alt="Home" class="navbar__logo">
|
|
</a>
|
|
{{ else }}
|
|
|
|
{{ end }}
|
|
{{ if ne .Site.Params.logoType "long" }}
|
|
<a href="{{ "/" | relLangURL }}" title="{{ i18n "tooltip-home" }}" rel="home" class="navbar__title-link">
|
|
<h6 class="navbar__title">{{ .Site.Params.logoText }}</h6>
|
|
</a>
|
|
{{ end }}
|
|
</div>
|
|
|
|
{{ partial "navbar/select-theme-mobile" . }}
|
|
{{ partial "search/site-search-mobile" . }}
|
|
|
|
<a role="button" class="navbar__burger" aria-label="menu" aria-expanded="false" data-ani="{{ $.Site.Params.enableUiAnimation | default "true" }}">
|
|
<span aria-hidden="true"></span>
|
|
<span aria-hidden="true"></span>
|
|
<span aria-hidden="true"></span>
|
|
</a>
|
|
|
|
<div class="navbar__menu">
|
|
{{ partial "navbar/select-theme" . }}
|
|
{{ $current := . }}
|
|
{{ range .Site.Menus.main }}
|
|
{{ $active := or ($current.IsMenuCurrent "main" .) ($current.HasMenuCurrent "main" .) }}
|
|
{{ $active = or $active (eq .Name $current.Title) }}
|
|
{{ $active = or $active (eq (lower .URL) (lower $current.Title)) }}
|
|
{{ $active = or $active (eq (lower .URL) (lower $current.Type)) }}
|
|
{{ if .HasChildren }}
|
|
<div class="navbar__dropdown navbar__slide-down" data-ani="{{ $.Site.Params.enableUiAnimation | default "true" }}">
|
|
<a href="{{ .URL | relLangURL }}" class="navbar__menu-item {{ if $active }}active{{ end }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">
|
|
{{ safeHTML .Name }}
|
|
<span class="navbar__menu-icon">
|
|
{{ partial "svgs/arrow/keyboard-arrow-down.svg" (dict "width" 18 "height" 18) }}
|
|
</span>
|
|
</a>
|
|
<div class="navbar__dropdown--content">
|
|
{{ range .Children }}
|
|
<a href="{{ .URL | relLangURL }}" class="navbar__dropdown--item" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">{{ safeHTML .Name }}</a>
|
|
{{ end }}
|
|
</div>
|
|
</div>
|
|
{{ else }}
|
|
<a href="{{ .URL | relLangURL }}" class="navbar__menu-item navbar__slide-down {{ if $active }}active{{ end }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}" data-ani="{{ $.Site.Params.enableUiAnimation | default "true" }}">{{ safeHTML .Name }}</a>
|
|
{{ end }}
|
|
{{ end }}
|
|
</div>
|
|
</nav> |