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