Skip to content
Permalink
Browse files

Merge pull request #56 from tarasmatsyk/add_gravatar_support

Add gravatar support
  • Loading branch information
htr3n committed Nov 23, 2018
2 parents d3780e0 + a02e364 commit 5ed13e17400bbc09a342b60fd50cd9fe3e6f1525
Showing with 13 additions and 6 deletions.
  1. +13 −6 layouts/partials/sidebar.html
@@ -5,12 +5,19 @@
<span class="site__title">
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
</span>
{{ with .Site.Params.authorimage }}
{{ $strippedSlash := ($.Site.Params.authorimage | replaceRE "^(/)+(.*)" "$2") }}
{{ $authorImage := (printf "%s/%s" $.Site.BaseURL $strippedSlash) }}
<div class="author-image">
<img src="{{$authorImage}}" alt="Author Image" class="img--circle img--headshot element--center">
</div>
{{ 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) }}
<div class="author-image">
<img src="{{$authorImage}}" alt="Author Image" class="img--circle img--headshot element--center">
</div>
{{ end }}
{{ end }}
{{ with .Site.Params.social.gravatar}}
<div class="author-image">
<img src="https://www.gravatar.com/avatar/{{md5 .}}?s=240&d=mp" class="img--circle img--headshot element--center" alt="gravatar">
</div>
{{ end }}
<p class="site__description">
{{ with .Site.Params.description }} {{.}} {{end}}

0 comments on commit 5ed13e1

Please sign in to comment.
You can’t perform that action at this time.