Add gravatar as a separate social param
Make gravatar and authorimage mutually exclusive
This commit is contained in:
parent
6b1f227642
commit
a02e3640c9
1 changed files with 9 additions and 7 deletions
|
@ -5,6 +5,7 @@
|
||||||
<span class="site__title">
|
<span class="site__title">
|
||||||
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
||||||
</span>
|
</span>
|
||||||
|
{{ if and (isset .Site.Params "authorimage") (not (isset .Site.Params.social "gravatar")) }}
|
||||||
{{ with .Site.Params.authorimage }}
|
{{ with .Site.Params.authorimage }}
|
||||||
{{ $strippedSlash := ($.Site.Params.authorimage | replaceRE "^(/)+(.*)" "$2") }}
|
{{ $strippedSlash := ($.Site.Params.authorimage | replaceRE "^(/)+(.*)" "$2") }}
|
||||||
{{ $authorImage := (printf "%s/%s" $.Site.BaseURL $strippedSlash) }}
|
{{ $authorImage := (printf "%s/%s" $.Site.BaseURL $strippedSlash) }}
|
||||||
|
@ -12,7 +13,8 @@
|
||||||
<img src="{{$authorImage}}" alt="Author Image" class="img--circle img--headshot element--center">
|
<img src="{{$authorImage}}" alt="Author Image" class="img--circle img--headshot element--center">
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ with .Site.Params.social.email}}
|
{{ end }}
|
||||||
|
{{ with .Site.Params.social.gravatar}}
|
||||||
<div class="author-image">
|
<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">
|
<img src="https://www.gravatar.com/avatar/{{md5 .}}?s=240&d=mp" class="img--circle img--headshot element--center" alt="gravatar">
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue