www/layouts/partials/nav.html

31 lines
978 B
HTML
Raw Normal View History

<header>
<nav>
2023-01-27 23:05:50 +01:00
<ol>
<li id="title"{{if .IsHome}} class="nav-menu-active"{{end}}>
<a href="/">{{ .Site.Title }}</a>
2023-01-25 17:45:06 +01:00
</li>
2023-01-27 23:05:50 +01:00
</ol>
<ol id="nav-menu">
{{- $p := . -}}
2023-01-27 23:05:50 +01:00
{{- range .Site.Menus.main.ByWeight -}}
{{- $active := or ($p.IsMenuCurrent "main" .) ($p.HasMenuCurrent "main" .) -}}
{{- with .Page -}}
{{- $active = or $active ( $.IsDescendant .) -}}
{{- end -}}
{{- $url := urls.Parse .URL -}}
{{- $baseurl := urls.Parse $.Site.Params.Baseurl -}}
<li{{if $active }} class="nav-menu-active"{{end}}>
2021-08-16 12:35:32 +02:00
<a href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}"{{ if ne $url.Host $baseurl.Host }}target="_blank" {{ end }}>{{ .Name }}</a>
</li>
{{ end }}
2023-01-27 23:05:50 +01:00
<li>
<select id="themes" onchange="setTheme()">
2023-01-27 23:05:50 +01:00
<option value="black-theme">Black</option>
<option value="dark-theme">Dark</option>
<option value="light-theme">Light</option>
</select>
</li>
</ol>
2021-08-16 09:43:46 +02:00
</nav>
</header>