diff options
author | Gustav Näslund <gustav@gntech.se> | 2019-11-04 21:50:27 +0300 |
---|---|---|
committer | Gustav Näslund <gustav@gntech.se> | 2019-11-04 21:50:27 +0300 |
commit | 8a094e628f584e6bea04900e11c111adbb80ca63 (patch) | |
tree | 98193214df958af4ce8f171ba98d91cba31a8afe | |
parent | f7a755e7e000a2f2ed7f2e402bc05d74d7d7b111 (diff) |
Add logo image
-rw-r--r-- | exampleSite/config.toml | 1 | ||||
-rw-r--r-- | layouts/partials/sidebar.html | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 05db08a..f360d71 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -23,6 +23,7 @@ theme = "hyde-hyde" dateformat = "Jan 2, 2006" # sidebar, copyright & license + #logoimage = "/img/hugo.png" copyright = "htr3n" license = "CC BY-SA 4.0" licenseURL = "https://creativecommons.org/licenses/by-sa/4.0" diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 2e33fec..e256384 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -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 }} |