website/layouts/partials/sidebar.html
Vri 🌈 39b8f480e4
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
fix continous deployment (#13)
Co-authored-by: vrifox <vrifox@vrifox.cc>
Reviewed-on: #13
2023-04-05 23:53:25 +02:00

44 lines
2 KiB
HTML

{{ $currentPage := . }}
<nav id="sidebar">
<header>
{{ with .Site.Params.avatar }}
{{ $avatar := resources.Get . }}
{{ $avatar := $avatar.Resize "64x webp" }}
<img id="avatar" alt="{{ $.Site.Params.displayName }}" src="{{ $avatar.RelPermalink }}" />
{{ end }}
</header>
<section id="sidebar-menu">
<ul>
{{- range .Site.Menus.main }}
{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}
<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>
{{ else }}
<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>
{{ end }}
{{- end }}
</ul>
</section>
<aside>
<section id="social-links">
<a class="hint-text" rel="me" href="https://social.anoxinon.de/@vri" data-title="Mastodon">{{ partial "helpers/icons" "mastodon" }}</a>
</section>
<section id="languages">
{{- if .Site.IsMultiLingual }}
{{ $siteLanguages := .Site.Languages }}
{{ $pageLanguage := .Page.Lang }}
{{ range .Page.AllTranslations }}
{{ $translation := . }}
{{ range $siteLanguages }}
{{ if eq $translation.Lang .Lang }}
{{ if ne $pageLanguage .Lang }}
<a class="hint-text" id="language" href="{{ $translation.Permalink }}" data-title="{{ .LanguageName }}">{{ .Params.languageFlag }}</a>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{- end }}
</section>
</aside>
</nav>