website/layouts/partials/sidebar.html

51 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 . }}
{{ $avatar := $avatar.Resize "200x webp" }}
<img id="avatar" alt="{{ $.Site.Params.displayName }}" src="{{ $avatar.RelPermalink }}" />
{{ end }}
2022-12-24 14:59:52 +01:00
<p id="name">{{ .Site.Params.displayName }}</p>
2023-01-12 23:08:47 +01:00
<div id="information">
<ul id="social-links">
<li><a rel="me" href="https://social.anoxinon.de/@vri">{{ partial "helpers/icons" "mastodon" }}</a></li>
</ul>
</div>
2022-12-24 14:59:52 +01:00
</header>
<section id="sidebar-menu">
<ul>
{{- 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>
2022-12-24 14:59:52 +01:00
{{ else }}
2023-01-06 21:47:57 +01:00
<li><a href="{{ .URL }}">{{ i18n .Identifier | default .Name }}</a></li>
2022-12-24 14:59:52 +01:00
{{ end }}
{{- end }}
</ul>
</section>
<aside>
{{- if .Site.IsMultiLingual }}
{{ $siteLanguages := .Site.Languages }}
{{ $pageLanguage := .Page.Lang }}
<div id="language-select">
<span id="language-icon" href="#" data-page-lang="{{ .Page.Lang }}">🌐</span>
<ul id="languages">
{{ range .Page.AllTranslations }}
{{ $translation := . }}
{{ range $siteLanguages }}
{{ if eq $translation.Lang .Lang }}
{{ if eq $pageLanguage .Lang }}
<li class="active"><a href="{{ $translation.Permalink }}">{{ .LanguageName }}</a></li>
{{ else }}
<li><a href="{{ $translation.Permalink }}">{{ .LanguageName }}</a></li>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</ul>
</div>
{{- end }}
</nav>