Hugo-theme-stack/layouts/partials/sidebar/left.html

46 lines
1.8 KiB
HTML
Raw Normal View History

2020-08-22 07:20:08 -04:00
<aside class="sidebar left-sidebar sticky">
2020-09-09 11:17:09 -04:00
<button class="hamburger hamburger--spin" type="button" id="toggle-menu" aria-label="{{ T `toggleMenu` }}">
2020-08-22 07:20:08 -04:00
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</button>
<header class="site-info">
2020-09-06 06:56:44 -04:00
{{ with .Site.Params.sidebar.avatar }}
<figure class="site-avatar">
2020-09-06 06:56:44 -04:00
{{ $avatar := resources.Get (.) }}
{{ if $avatar }}
{{ $avatarResized := $avatar.Resize "300x300" }}
<img src="{{ $avatarResized.RelPermalink }}" width="{{ $avatarResized.Width }}"
height="{{ $avatarResized.Height }}" class="site-logo" loading="lazy" alt="Avatar">
{{ else }}
{{ errorf "Failed loading avatar from %q" . }}
{{ end }}
{{ with $.Site.Params.sidebar.emoji }}
<span class="emoji">{{ . }}</span>
{{ end }}
</figure>
{{ end }}
2020-08-22 07:20:08 -04:00
<h1 class="site-name"><a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></h1>
2020-09-06 06:56:44 -04:00
<h2 class="site-description">{{ .Site.Params.sidebar.subtitle }}</h2>
2020-08-22 07:20:08 -04:00
</header>
2020-09-14 07:38:24 -04:00
<ol class="menu" id="main-menu">
2020-08-22 07:20:08 -04:00
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
{{ $active := or (eq $currentPage.Title .Name) (or ($currentPage.HasMenuCurrent "main" .) ($currentPage.IsMenuCurrent "main" .)) }}
<li {{ if $active }} class='current' {{ end }}>
<a href='{{ .URL | relURL }}'>
{{ if .Pre }}
2020-10-09 18:27:56 -04:00
{{ partial "helper/icon" .Pre }}
{{ end }}
2020-08-22 07:20:08 -04:00
<span>{{- .Name -}}</span>
</a>
</li>
{{ end }}
2020-09-14 07:38:24 -04:00
</ol>
</aside>