Merge pull request #90 from gntech/logoimage

Add logo image
This commit is contained in:
Huy Tran 2020-11-03 11:24:38 +11:00 committed by GitHub
commit a4ecbb1e8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -23,6 +23,7 @@ theme = "hyde-hyde"
dateformat = "Jan 2, 2006"
# sidebar, copyright & license
#logoimage = "/img/hugo.png"
copyright = "htr3n"
since = 2019
license = "CC BY-SA 4.0"

View file

@ -3,7 +3,15 @@
<div class="container {{ with .Site.Params.sidebarSticky }}sidebar-sticky{{ end }}">
<div class="sidebar-about">
<span class="site__title">
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
<a href="{{ .Site.BaseURL }}">
{{ with .Site.Params.logoimage }}
{{ $strippedSlash := ($.Site.Params.logoimage | replaceRE "^(/)+(.*)" "$2") }}
{{ $logoImage := (printf "%s%s" $.Site.BaseURL $strippedSlash) }}
<img src="{{$logoImage}}" alt="Logo Image" class="element--center">
{{ else }}
{{ .Site.Title }}
{{ end }}
</a>
</span>
{{ if and (isset .Site.Params "authorimage") (not (isset .Site.Params.social "gravatar")) }}
{{ with .Site.Params.authorimage }}