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,12 +5,19 @@
|
||||||
<span class="site__title">
|
<span class="site__title">
|
||||||
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
||||||
</span>
|
</span>
|
||||||
{{ with .Site.Params.authorimage }}
|
{{ if and (isset .Site.Params "authorimage") (not (isset .Site.Params.social "gravatar")) }}
|
||||||
{{ $strippedSlash := ($.Site.Params.authorimage | replaceRE "^(/)+(.*)" "$2") }}
|
{{ with .Site.Params.authorimage }}
|
||||||
{{ $authorImage := (printf "%s/%s" $.Site.BaseURL $strippedSlash) }}
|
{{ $strippedSlash := ($.Site.Params.authorimage | replaceRE "^(/)+(.*)" "$2") }}
|
||||||
<div class="author-image">
|
{{ $authorImage := (printf "%s/%s" $.Site.BaseURL $strippedSlash) }}
|
||||||
<img src="{{$authorImage}}" alt="Author Image" class="img--circle img--headshot element--center">
|
<div class="author-image">
|
||||||
</div>
|
<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 }}
|
{{ end }}
|
||||||
<p class="site__description">
|
<p class="site__description">
|
||||||
{{ with .Site.Params.description }} {{.}} {{end}}
|
{{ with .Site.Params.description }} {{.}} {{end}}
|
||||||
|
|
Loading…
Reference in a new issue