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

37 lines
No EOL
1.6 KiB
HTML

<aside class="sidebar left-sidebar sticky">
<button class="hamburger hamburger--spin" type="button" id="toggle-menu" aria-label="Toggle Menu">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</button>
<header class="site-info">
{{ if .Site.Params.avatar }}
<figure class="site-avatar">
{{ $avatar := resources.Get (.Site.Params.avatar) }}
{{ $avatarResized := $avatar.Resize "300x300" }}
<img src="{{ $avatarResized.RelPermalink }}" width="{{ $avatarResized.Width }}"
height="{{ $avatarResized.Height }}" class="site-logo" loading="lazy" alt="Avatar">
<span class="emoji">{{ .Site.Params.emoji }}</span>
</figure>
{{ end }}
<h1 class="site-name"><a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></h1>
<h2 class="site-description">{{ .Site.Params.subtitle }}</h2>
</header>
<nav class="menu" id="main-menu">
{{ $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 }}'>
{{ if .Pre }}
{{ (resources.Get (delimit (slice "icons/" .Pre ".svg") "")).Content | safeHTML }}
{{ end }}
<span>{{- .Name -}}</span>
</a>
</li>
{{ end }}
</nav>
</aside>