Fix deprecated use of gravatar_id with the GitHub API

This commit is contained in:
Saivann 2014-09-23 10:47:56 -04:00
parent 468f48686a
commit 48d47dd035
3 changed files with 5 additions and 5 deletions

View file

@ -55,9 +55,9 @@ module Jekyll
x = {}
x['name'] = name
x['contributions'] = c['contributions']
# Set gravatar_id when available
if c.has_key?('gravatar_id') and c['gravatar_id'].is_a?(String) and /^[A-Za-z0-9\-]{1,150}$/.match(c['gravatar_id'])
x['gravatar_id'] = c['gravatar_id']
# Set avatar_url when available
if c.has_key?('avatar_url') and c['avatar_url'].is_a?(String) and /^https:\/\/avatars\.githubusercontent\.com\/u\/[0-9]{1,10}\?v=[0-9]{1,2}$/.match(c['avatar_url'])
x['avatar_url'] = c['avatar_url'] + '&size=16'
end
# Set login when available
if c.has_key?('login') and c['login'].is_a?(String) and /^[A-Za-z0-9\-]{1,150}$/.match(c['login'])