mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2023-12-21 10:22:58 +01:00
2eef3fcc12
usage: add to config params: defaultTheme: "auto"
25 lines
788 B
HTML
25 lines
788 B
HTML
{{ if eq .Site.Params.defaultTheme "auto" }}
|
|
<script>
|
|
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
document.body.classList.add('dark');
|
|
}
|
|
</script>
|
|
{{ end }}
|
|
<header class="header">
|
|
<nav class="nav">
|
|
{{- if .IsHome }}
|
|
<h1 class="logo"><a href="{{ "" | absLangURL }}">{{ .Site.Title }}</a></h1>
|
|
{{- else }}
|
|
<p class="logo"><a href="{{ "" | absLangURL }}">{{ .Site.Title }}</a></p>
|
|
{{- end }}
|
|
{{- if .Site.Menus.main }}
|
|
<ul class="menu" id="menu" onscroll="menu_on_scroll()">
|
|
{{- range .Site.Menus.main }}
|
|
<li>
|
|
<a href="{{ .URL | absLangURL}}">{{ .Name }}</a>
|
|
</li>
|
|
{{- end }}
|
|
</ul>
|
|
{{- end }}
|
|
</nav>
|
|
</header> |