From ee54b74aa9700f5d8e80acfdcf0d3db1993efc4e Mon Sep 17 00:00:00 2001 From: Nicole Orchard Date: Mon, 30 Jan 2017 19:43:14 +0700 Subject: [PATCH] Fixed missing avatar. Avatars were previously generated from gravatar_id, which is deprecated. (https://developer.github.com/changes/2014-09-05-removing-gravatar-id/) Avatar display is now implemented using only avatar_url. --- js/githubresume.js | 7 ++----- views/resume.html | 4 +--- views/resumeOrgs.html | 4 +--- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/js/githubresume.js b/js/githubresume.js index fd4b48f..f8b65f5 100644 --- a/js/githubresume.js +++ b/js/githubresume.js @@ -213,11 +213,8 @@ var run = function() { name = data.name; } - var avatar = ''; - if (data.type == 'Organization'){ - avatar = data.avatar_url.match(/https:\/\/secure.gravatar.com\/avatar\/[0-9a-z]+/)[0]; - avatar += '?s=140&d=https://github.com/images/gravatars/gravatar-140.png'; - } + var avatar = data.avatar_url.match(/https:\/\/avatars.githubusercontent.com\/u\/[0-9a-z]+/)[0]; + avatar += '?s=140&d=https://github.com/images/gravatars/gravatar-140.png'; var view = { name: name, diff --git a/views/resume.html b/views/resume.html index c018132..be4174d 100644 --- a/views/resume.html +++ b/views/resume.html @@ -16,9 +16,7 @@

{{userStatus}}

- {{#gravatar_id}} - avatar - {{/gravatar_id}} + {{#avatar_url}}avatar{{/avatar_url}} {{#email}}

{{/email}}
diff --git a/views/resumeOrgs.html b/views/resumeOrgs.html index 70aade6..b150495 100644 --- a/views/resumeOrgs.html +++ b/views/resumeOrgs.html @@ -12,9 +12,7 @@

Github organization

- {{#gravatar_id}} - avatar - {{/gravatar_id}} + {{#avatar_url}}avatar{{/avatar_url}} {{#email}}

{{email}}

{{/email}}