From a02e3640c922befdcfdb82158557ca160a1fbdb8 Mon Sep 17 00:00:00 2001 From: Taras Matsyk Date: Fri, 23 Nov 2018 22:22:36 +0200 Subject: [PATCH] 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