2020-09-17 11:58:03 +02:00
|
|
|
{{ if eq .Site.Params.defaultTheme "auto" }}
|
|
|
|
<script>
|
|
|
|
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
|
|
document.body.classList.add('dark');
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{{ end }}
|
2020-07-21 12:06:30 +02:00
|
|
|
<header class="header">
|
|
|
|
<nav class="nav">
|
|
|
|
{{- if .IsHome }}
|
2020-08-24 22:10:02 +02:00
|
|
|
<h1 class="logo"><a href="{{ "" | absLangURL }}">{{ .Site.Title }}</a></h1>
|
2020-07-21 12:06:30 +02:00
|
|
|
{{- else }}
|
2020-08-24 22:10:02 +02:00
|
|
|
<p class="logo"><a href="{{ "" | absLangURL }}">{{ .Site.Title }}</a></p>
|
2020-07-20 17:02:07 +02:00
|
|
|
{{- end }}
|
2020-09-20 15:33:43 +02:00
|
|
|
{{ $currentPage := . }}
|
2020-08-21 17:33:05 +02:00
|
|
|
<ul class="menu" id="menu" onscroll="menu_on_scroll()">
|
2020-07-21 12:06:30 +02:00
|
|
|
{{- range .Site.Menus.main }}
|
2020-09-20 15:33:43 +02:00
|
|
|
{{ $menu_item_url := .URL | relLangURL }}
|
|
|
|
{{ $page_url:= $currentPage.RelPermalink | relLangURL }}
|
2020-07-21 12:06:30 +02:00
|
|
|
<li>
|
2020-09-20 15:33:43 +02:00
|
|
|
<a href="{{ .URL | absLangURL }}">
|
|
|
|
<span {{ if eq $menu_item_url $page_url }}
|
|
|
|
{{/* the menu item links to the current page (with relLangURL) */}} class="active"
|
|
|
|
{{ end }}>{{ .Name }}</span>
|
|
|
|
</a>
|
2020-07-21 12:06:30 +02:00
|
|
|
</li>
|
|
|
|
{{- end }}
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</header>
|