From 6b1f227642c466436bd91394eeb6b1b7e16fb886 Mon Sep 17 00:00:00 2001 From: Taras Matsyk Date: Thu, 22 Nov 2018 22:37:00 +0200 Subject: [PATCH 1/2] Add gravatar support --- layouts/partials/sidebar.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 8c03b9b..104c868 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -12,6 +12,11 @@ Author Image {{ end }} + {{ with .Site.Params.social.email}} +
+ gravatar +
+ {{ end }}

{{ with .Site.Params.description }} {{.}} {{end}}

From a02e3640c922befdcfdb82158557ca160a1fbdb8 Mon Sep 17 00:00:00 2001 From: Taras Matsyk Date: Fri, 23 Nov 2018 22:22:36 +0200 Subject: [PATCH 2/2] Add gravatar as a separate social param Make gravatar and authorimage mutually exclusive --- layouts/partials/sidebar.html | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 104c868..c712005 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -5,14 +5,16 @@ {{ .Site.Title }} - {{ with .Site.Params.authorimage }} - {{ $strippedSlash := ($.Site.Params.authorimage | replaceRE "^(/)+(.*)" "$2") }} - {{ $authorImage := (printf "%s/%s" $.Site.BaseURL $strippedSlash) }} -
- Author Image -
+ {{ if and (isset .Site.Params "authorimage") (not (isset .Site.Params.social "gravatar")) }} + {{ with .Site.Params.authorimage }} + {{ $strippedSlash := ($.Site.Params.authorimage | replaceRE "^(/)+(.*)" "$2") }} + {{ $authorImage := (printf "%s/%s" $.Site.BaseURL $strippedSlash) }} +
+ Author Image +
+ {{ end }} {{ end }} - {{ with .Site.Params.social.email}} + {{ with .Site.Params.social.gravatar}}
gravatar