mirror of
https://github.com/meineerde/holgerjust.de.git
synced 2025-10-17 17:01:01 +00:00
Allow to specify the final gravatar in the settings to avoid raw email adresses
This commit is contained in:
parent
954fdf872f
commit
9d0c0af54d
@ -85,10 +85,15 @@ module MiddlemanCasperHelpers
|
||||
end
|
||||
|
||||
def gravatar(size = 68)
|
||||
md5 = Digest::MD5.hexdigest(blog_author.gravatar_email.downcase)
|
||||
"https://www.gravatar.com/avatar/#{md5}?size=#{size}"
|
||||
if blog_author.avatar_url.present?
|
||||
"#{blog_author.avatar_url}?size=#{size}"
|
||||
else
|
||||
md5 = Digest::MD5.hexdigest(blog_author.gravatar_email.downcase)
|
||||
"https://www.gravatar.com/avatar/#{md5}?size=#{size}"
|
||||
end
|
||||
end
|
||||
def gravatar?
|
||||
blog_author.avatar_url.present? ||
|
||||
blog_author.gravatar_email.present?
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user