website/layouts/partials/sidebar.html

45 lines
2.1 KiB
HTML
Raw Normal View History

2022-12-24 14:59:52 +01:00
{{ $currentPage := . }}
2023-05-18 13:17:48 +02:00
<header id="sidebar">
<div id="avatar-wrapper">
2023-01-18 13:28:32 +01:00
{{ with .Site.Params.avatar }}
{{ $avatar := resources.Get . }}
2023-05-17 14:50:54 +02:00
{{ $avatar := $avatar.Resize "96x webp" }}
2023-01-18 13:28:32 +01:00
<img id="avatar" alt="{{ $.Site.Params.displayName }}" src="{{ $avatar.RelPermalink }}" />
{{ end }}
2023-05-18 13:17:48 +02:00
</div>
<nav id="sidebar-menu" aria-labelledby="primary-navigation">
2022-12-24 14:59:52 +01:00
<ul>
2023-03-05 23:22:05 +01:00
{{- range .Site.Menus.main }}
2023-03-16 18:59:31 +01:00
{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}
2023-04-05 23:23:32 +02:00
<li class="active"><a class="hint-text" href="{{ .URL }}" data-title="{{ i18n .Identifier | default .Name }}" aria-label="{{ i18n .Identifier | default .Name }}">{{ partial "helpers/icons" .Identifier }}</a></li>
2023-03-16 18:59:31 +01:00
{{ else }}
2023-04-05 23:23:32 +02:00
<li><a class="hint-text" href="{{ .URL }}" data-title="{{ i18n .Identifier | default .Name }}" aria-label="{{ i18n .Identifier | default .Name }}">{{ partial "helpers/icons" .Identifier }}</a></li>
2023-03-16 18:59:31 +01:00
{{ end }}
2023-03-05 23:22:05 +01:00
{{- end }}
2022-12-24 14:59:52 +01:00
</ul>
2023-05-18 13:17:48 +02:00
</nav>
<div>
<nav id="social-links" aria-labelledby="social-links">
2023-05-17 14:30:00 +02:00
<a class="hint-text" rel="me" href="https://social.anoxinon.de/@vri" aria-label="Mastodon">{{ partial "helpers/icons" "mastodon" }}</a>
2023-05-18 13:17:48 +02:00
</nav>
<div id="languages">
2023-03-09 18:16:35 +01:00
{{- 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 }}
2023-05-17 14:30:00 +02:00
<a class="hint-text" id="language" href="{{ $translation.Permalink }}" aria-label="{{ .LanguageName }}">{{ .Params.languageFlag }}</a>
2022-12-24 14:59:52 +01:00
{{ end }}
{{ end }}
{{ end }}
{{ end }}
2023-03-09 18:16:35 +01:00
{{- end }}
2023-05-18 13:17:48 +02:00
</div>
</div>
</header>