simoncor.net/themes/hugo-coder/layouts/partials/header.html

42 lines
1.5 KiB
HTML
Raw Normal View History

2020-07-16 22:43:30 +02:00
<nav class="navigation">
<section class="container">
2024-08-26 17:13:18 +02:00
{{ with .Site }}
<a class="navigation-title" href="{{ absLangURL "" }}">
{{ .Title }}
2020-07-16 22:43:30 +02:00
</a>
2024-08-26 17:13:18 +02:00
{{ end }}
{{ if or .Site.Menus.main hugo.IsMultilingual }}
<input type="checkbox" id="menu-toggle" />
<label class="menu-button float-right" for="menu-toggle">
<i class="fa-solid fa-bars fa-fw" aria-hidden="true"></i>
</label>
<ul class="navigation-list">
{{ with .Site.Menus.main}}
{{ range sort . }}
<li class="navigation-item">
<a class="navigation-link {{ .Params.class }}" href="{{ index (apply (slice .URL) (.Params.urlFunc | default "relLangURL") ".") 0 }}">{{ .Name }}</a>
</li>
{{ end }}
2020-07-16 22:43:30 +02:00
{{ end }}
2024-08-26 17:13:18 +02:00
{{ if hugo.IsMultilingual }}
{{ $node := . }}
{{ .Scratch.Set "separator" true }}
{{ range (default .Site.Home.AllTranslations .Translations) }}
{{ if ne $.Site.Language .Language }}
{{ if $node.Scratch.Get "separator" }}
<li class="navigation-item menu-separator">
<span>|</span>
</li>
{{ $node.Scratch.Set "separator" false }}
{{ end }}
<li class="navigation-item">
<a href="{{ .RelPermalink }}">{{ .Language.LanguageName | emojify }}</a>
2020-07-16 22:43:30 +02:00
</li>
{{ end }}
{{ end }}
{{ end }}
2024-08-26 17:13:18 +02:00
</ul>
2020-07-16 22:43:30 +02:00
{{ end }}
</section>
</nav>