add gravatar cdn support
This commit is contained in:
parent
40b26fcd68
commit
18abfa9daf
1 changed files with 4 additions and 2 deletions
|
@ -23,9 +23,11 @@
|
|||
{{ if in site.Params.avatar "http" }}<!---->
|
||||
{{ $.Scratch.Set "avatar_url" site.Params.avatar }}<!---->
|
||||
{{ else }}<!---->
|
||||
{{ $official_cdn := "https://www.gravatar.com/avatar/" }}<!---->
|
||||
{{ $cdn := (site.Params.gravatarCdn | default $official_cdn) }}<!---->
|
||||
{{ $md5 := (md5 site.Params.avatar) }}<!---->
|
||||
{{ $url := print "https://www.gravatar.com/avatar/" $md5 "?s=160&d=identicon" }}<!---->
|
||||
{{ $.Scratch.Set "avatar_url" $url }}<!---->
|
||||
{{ $avatar_url := print $cdn $md5 "?s=160&d=identicon" }}<!---->
|
||||
{{ $.Scratch.Set "avatar_url" $avatar_url }}<!---->
|
||||
{{ end }}<!---->
|
||||
{{ end }}<!---->
|
||||
|
||||
|
|
Loading…
Reference in a new issue