Module: Jekyll::GravatarFilter

Defined in:
jekyll/_plugins/to_gravatar.rb

Instance Method Summary collapse

Instance Method Details

#hash(email) ⇒ Object



17
18
19
20
# File 'jekyll/_plugins/to_gravatar.rb', line 17

def hash(email)
  email_address = email ? email.downcase.strip : ''
  Digest::MD5.hexdigest(email_address)
end

#to_gravatar(input, size = 135, default = '') ⇒ Object



7
8
9
# File 'jekyll/_plugins/to_gravatar.rb', line 7

def to_gravatar(input, size=135, default='')
  "https://www.gravatar.com/avatar/#{hash(input)}?s=#{size}&d=#{default}"
end

#to_gravatar_profile(input) ⇒ Object



11
12
13
# File 'jekyll/_plugins/to_gravatar.rb', line 11

def to_gravatar_profile(input)
     "https://www.gravatar.com/#{hash(input)}"
end