feat(sidebar): add option to disable avatar in left sidebar (#268)

* Allow to disable logo image in left sidebar

* Enable sidebar avatar by default for backward compatibility

Co-authored-by: Jimmy Cai <github@jimmycai.com>
This commit is contained in:
Hendra Manudinata 2021-07-23 16:56:52 +08:00 committed by GitHub
parent 8cb11d721f
commit a25e6463bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -37,6 +37,7 @@ params:
emoji: 🍥
subtitle: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
avatar:
enabled: true
local: true
src: img/avatar.png

View file

@ -7,6 +7,7 @@
<header class="site-info">
{{ with .Site.Params.sidebar.avatar }}
{{ if (default true .enabled) }}
<figure class="site-avatar">
{{ if not .local }}
<img src="{{ .src }}" width="300" height="300" class="site-logo" loading="lazy" alt="Avatar">
@ -27,6 +28,7 @@
{{ end }}
</figure>
{{ end }}
{{ end }}
<h1 class="site-name"><a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></h1>
<h2 class="site-description">{{ .Site.Params.sidebar.subtitle }}</h2>
</header>