Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/htr3n/hyde-hyde.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuy Tran <hoang.huy.tran@gmail.com>2020-11-03 03:24:38 +0300
committerGitHub <noreply@github.com>2020-11-03 03:24:38 +0300
commita4ecbb1e8f8a9b1162565a1f5cc2f255a4cd26a2 (patch)
tree38eb60e5b0b9b80967dd5b0a2d958a2bf1e1716a
parentc70c3fe5643747fa84d2983296e94d90f5192903 (diff)
parent8a094e628f584e6bea04900e11c111adbb80ca63 (diff)
Merge pull request #90 from gntech/logoimage
Add logo image
-rw-r--r--exampleSite/config.toml1
-rw-r--r--layouts/partials/sidebar.html10
2 files changed, 10 insertions, 1 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index bb4d64c..6d83d22 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"
since = 2019
license = "CC 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 }}