website/layouts/partials/sidebar.html

45 lines
2 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 }}
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>
</section>
2023-03-09 18:16:35 +01:00
<aside>
<section id="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-03-09 18:16:35 +01:00
</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 }}
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 }}
</section>
</aside>
2022-12-24 14:59:52 +01:00
</nav>