2022-03-04 04:24:21 -05:00
< aside class = "sidebar left-sidebar sticky {{ if .Site.Params.sidebar.compact }}compact{{ end }}" >
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 >
2022-03-03 17:11:19 -05:00
< header >
2020-09-06 06:56:44 -04:00
{{ with .Site.Params.sidebar.avatar }}
2022-10-29 11:14:19 -04:00
{{ if (default true .enabled) }}
2020-08-24 15:20:59 -04:00
< figure class = "site-avatar" >
2022-01-20 05:38:16 -05:00
< a href = "{{ .Site.BaseURL | relLangURL }}" >
2020-12-11 10:33:02 -05:00
{{ if not .local }}
< img src = "{{ .src }}" width = "300" height = "300" class = "site-logo" loading = "lazy" alt = "Avatar" >
2020-09-06 06:56:44 -04:00
{{ else }}
2020-12-11 10:33:02 -05:00
{{ $avatar := resources.Get (.src) }}
{{ if $avatar }}
{{ $avatarResized := $avatar.Resize "300x" }}
< 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 }}
2020-09-06 06:56:44 -04:00
{{ end }}
2022-01-20 05:38:16 -05:00
< / a >
2020-11-23 04:01:39 -05:00
{{ with $.Site.Params.sidebar.emoji }}
2020-11-23 04:47:22 -05:00
< span class = "emoji" > {{ . }}< / span >
2020-11-23 04:01:39 -05:00
{{ end }}
2020-08-24 15:20:59 -04:00
< / figure >
2021-07-23 04:56:52 -04:00
{{ end }}
2020-08-24 15:20:59 -04:00
{{ end }}
2021-10-23 05:58:55 -04:00
2022-03-03 17:11:19 -05:00
< div class = "site-meta" >
< h1 class = "site-name" > < a href = "{{ .Site.BaseURL | relLangURL }}" > {{ .Site.Title }}< / a > < / h1 >
< h2 class = "site-description" > {{ .Site.Params.sidebar.subtitle }}< / h2 >
< / div >
2020-08-22 07:20:08 -04:00
< / header >
2022-03-04 04:24:21 -05:00
{{- with .Site.Menus.social -}}
< ol class = "social-menu" >
{{ range . }}
< li >
< a
href='{{ .URL }}'
{{ if eq (default true .Params.newTab) true }}target="_blank"{{ end }}
{{ with .Name }}title="{{ . }}"{{ end }}
2022-10-29 08:04:21 -04:00
rel="me"
2022-03-04 04:24:21 -05:00
>
{{ $icon := default "link" .Params.Icon }}
{{ with $icon }}
{{ partial "helper/icon" . }}
{{ end }}
< / a >
< / li >
{{ end }}
< / ol >
{{- end -}}
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 } } >
2022-10-29 11:28:47 -04:00
< a href = '{{ .URL }}' { { if eq . Params . newTab true } } target = "_blank" { { end } } >
2021-10-23 03:18:44 -04:00
{{ $icon := default .Pre .Params.Icon }}
2020-08-24 15:20:59 -04:00
{{ if .Pre }}
2021-10-23 03:18:44 -04:00
{{ warnf "Menu item [%s] is using [pre] field to set icon, please use [params.icon] instead.\nMore information: https://docs.stack.jimmycai.com/configuration/custom-menu.html" .URL }}
{{ end }}
{{ with $icon }}
{{ partial "helper/icon" . }}
2020-08-24 15:20:59 -04:00
{{ end }}
2020-08-22 07:20:08 -04:00
< span > {{- .Name -}}< / span >
< / a >
< / li >
{{ end }}
2024-03-10 17:56:30 -04:00
< li class = "menu-bottom-section" >
< ol class = "menu" >
{{- $currentLanguageCode := .Language.Lang -}}
{{ if ( compare.Gt .Site.Home.AllTranslations.Len 1 ) }}
{{ with .Site.Home.AllTranslations }}
< li id = "i18n-switch" >
{{ partial "helper/icon" "language" }}
< select name = "language" title = "language" onchange = "window.location.href = this.selectedOptions[0].value" >
{{ range . }}
< option value = "{{ .Permalink }}" { { if eq . Language . Lang $ currentLanguageCode } } selected { { end } } > {{ .Language.LanguageName }}< / option >
{{ end }}
< / select >
< / li >
{{ end }}
2024-02-26 06:43:14 -05:00
{{ end }}
2024-03-10 17:56:30 -04:00
{{ if (default false .Site.Params.colorScheme.toggle) }}
< li id = "dark-mode-toggle" >
{{ partial "helper/icon" "toggle-left" }}
{{ partial "helper/icon" "toggle-right" }}
< span > {{ T "darkMode" }}< / span >
< / li >
{{ end }}
< / ol >
< / li >
< / ol >
2020-11-23 04:47:22 -05:00
< / aside >