website/layouts/partials/sidebar.html

47 lines
1.7 KiB
HTML
Raw Normal View History

2022-12-24 14:59:52 +01:00
{{ $currentPage := . }}
<nav id="sidebar">
<header>
2023-01-18 13:28:32 +01:00
{{ with .Site.Params.avatar }}
{{ $avatar := resources.Get . }}
2023-03-09 22:17:14 +01:00
{{ $avatar := $avatar.Resize "64x webp" }}
2023-01-18 13:28:32 +01:00
<img id="avatar" alt="{{ $.Site.Params.displayName }}" src="{{ $avatar.RelPermalink }}" />
{{ end }}
2022-12-24 14:59:52 +01:00
</header>
<section id="sidebar-menu">
<ul>
2023-03-05 23:22:05 +01:00
{{- range .Site.Menus.main }}
{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}
2023-01-06 21:47:57 +01:00
<li class="active"><a href="{{ .URL }}">{{ i18n .Identifier | default .Name }}</a></li>
2023-03-05 23:22:05 +01:00
{{ else }}
2023-01-06 21:47:57 +01:00
<li><a href="{{ .URL }}">{{ i18n .Identifier | default .Name }}</a></li>
2023-03-05 23:22:05 +01:00
{{ end }}
{{- end }}
2022-12-24 14:59:52 +01:00
</ul>
</section>
2023-03-09 18:16:35 +01:00
<aside>
<section id="social-links">
<ul>
<li><a rel="me" href="https://social.anoxinon.de/@vri">{{ partial "helpers/icons" "mastodon" }}</a></li>
</ul>
</section>
<section id="languages">
{{- if .Site.IsMultiLingual }}
{{ $siteLanguages := .Site.Languages }}
{{ $pageLanguage := .Page.Lang }}
2022-12-24 14:59:52 +01:00
{{ range .Page.AllTranslations }}
{{ $translation := . }}
{{ range $siteLanguages }}
{{ if eq $translation.Lang .Lang }}
2023-03-09 18:16:35 +01:00
{{ if ne $pageLanguage .Lang }}
<a id="language" href="{{ $translation.Permalink }}">{{ .Params.languageFlag }}</a>
2022-12-24 14:59:52 +01:00
{{ end }}
{{ end }}
{{ end }}
{{ end }}
2023-03-09 18:16:35 +01:00
{{- end }}
</section>
</aside>
2022-12-24 14:59:52 +01:00
</nav>