Merge pull request #56 from tarasmatsyk/add_gravatar_support
Add gravatar support
This commit is contained in:
commit
5ed13e1740
1 changed files with 13 additions and 6 deletions
|
@ -5,6 +5,7 @@
|
|||
<span class="site__title">
|
||||
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
||||
</span>
|
||||
{{ 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) }}
|
||||
|
@ -12,6 +13,12 @@
|
|||
<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}}
|
||||
</p>
|
||||
|
|
Loading…
Reference in a new issue