mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-27 12:03:49 +01:00
43 lines
No EOL
1.7 KiB
HTML
43 lines
No EOL
1.7 KiB
HTML
<aside class="sidebar left-sidebar sticky">
|
|
<button class="hamburger hamburger--spin" type="button" id="toggle-menu" aria-label="{{ T `toggleMenu` }}">
|
|
<span class="hamburger-box">
|
|
<span class="hamburger-inner"></span>
|
|
</span>
|
|
</button>
|
|
|
|
<header class="site-info">
|
|
{{ with .Site.Params.sidebar.avatar }}
|
|
<figure class="site-avatar">
|
|
{{ $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 }}
|
|
|
|
<span class="emoji">{{ $.Site.Params.sidebar.emoji }}</span>
|
|
</figure>
|
|
{{ end }}
|
|
<h1 class="site-name"><a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></h1>
|
|
<h2 class="site-description">{{ .Site.Params.sidebar.subtitle }}</h2>
|
|
</header>
|
|
|
|
<ol 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 | relURL }}'>
|
|
{{ if .Pre }}
|
|
{{ partial "helper/icon" .Pre }}
|
|
{{ end }}
|
|
<span>{{- .Name -}}</span>
|
|
</a>
|
|
</li>
|
|
{{ end }}
|
|
</ol>
|
|
</aside> |