diff --git a/.all-contributorsrc b/.all-contributorsrc index 51e01a6..5287317 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -7,7 +7,7 @@ "login": "jfmengels" , "name": "Jeroen Engels" , "avatar_url": "https://avatars.githubusercontent.com/u/3869412?v=3" - , "html_url": "https://github.com/jfmengels" + , "profile": "https://github.com/jfmengels" , "contributions": [ "code" , "doc" @@ -18,7 +18,7 @@ "login": "kentcdodds" , "name": "Kent C. Dodds" , "avatar_url": "https://avatars.githubusercontent.com/u/1500684?v=3" - , "html_url": "http://kentcdodds.com/" + , "profile": "http://kentcdodds.com/" , "contributions": [ "doc" ] diff --git a/lib/contributors/add.test.js b/lib/contributors/add.test.js index 5dfa883..a8b2b85 100644 --- a/lib/contributors/add.test.js +++ b/lib/contributors/add.test.js @@ -6,7 +6,7 @@ function mockInfoFetcher(username, cb) { login: username, name: 'Some name', avatar_url: 'www.avatar.url', - html_url: 'www.html.url' + profile: 'www.profile.url' }); } @@ -16,7 +16,7 @@ function fixtures() { login: 'login1', name: 'Some name', avatar_url: 'www.avatar.url', - html_url: 'www.html.url', + profile: 'www.profile.url', contributions: [ 'code' ] @@ -24,7 +24,7 @@ function fixtures() { login: 'login2', name: 'Some name', avatar_url: 'www.avatar.url', - html_url: 'www.html.url', + profile: 'www.profile.url', contributions: [ { type: 'blog', url: 'www.blog.url/path' }, 'code' @@ -60,7 +60,7 @@ test.cb('should add new contributor at the end of the list of contributors', t = login: 'login3', name: 'Some name', avatar_url: 'www.avatar.url', - html_url: 'www.html.url', + profile: 'www.profile.url', contributions: [ 'doc' ] @@ -82,7 +82,7 @@ test.cb('should add new contributor at the end of the list of contributors with login: 'login3', name: 'Some name', avatar_url: 'www.avatar.url', - html_url: 'www.html.url', + profile: 'www.profile.url', contributions: [ { type: 'doc', url: 'www.foo.bar' } ] @@ -115,7 +115,7 @@ test.cb(`should update an existing contributor's contributions if a new type is login: 'login1', name: 'Some name', avatar_url: 'www.avatar.url', - html_url: 'www.html.url', + profile: 'www.profile.url', contributions: [ 'code', 'bug' @@ -138,7 +138,7 @@ test.cb(`should update an existing contributor's contributions if a new type is login: 'login1', name: 'Some name', avatar_url: 'www.avatar.url', - html_url: 'www.html.url', + profile: 'www.profile.url', contributions: [ 'code', { type: 'bug', url: 'www.foo.bar' }, diff --git a/lib/contributors/github.js b/lib/contributors/github.js index 6a239a8..69a2bf2 100644 --- a/lib/contributors/github.js +++ b/lib/contributors/github.js @@ -13,7 +13,13 @@ module.exports = function getUserInfo(username, cb) { if (error) { return cb(error); } - var user = JSON.parse(res.body); - return cb(null, _.pick(['login', 'name', 'avatar_url', 'html_url'], user)); + var body = JSON.parse(res.body); + var user = { + login: body.login, + name: body.name, + avatar_url: body.avatar_url, + profile: body.blog || body.html_url + }; + return cb(null, user); }); } diff --git a/lib/generate/fixtures/contributors.json b/lib/generate/fixtures/contributors.json index e552440..8032036 100644 --- a/lib/generate/fixtures/contributors.json +++ b/lib/generate/fixtures/contributors.json @@ -2,7 +2,7 @@ "kentcdodds": { "login": "kentcdodds", "name": "Kent C. Dodds", - "html_url": "http://kentcdodds.com", + "profile": "http://kentcdodds.com", "avatar_url": "https://avatars1.githubusercontent.com/u/1500684", "contributions": [ "doc", @@ -13,7 +13,7 @@ "bogas04": { "login": "bogas04", "name": "Divjot Singh", - "html_url": "http://bogas04.github.io", + "profile": "http://bogas04.github.io", "avatar_url": "https://avatars1.githubusercontent.com/u/6177621", "contributions": [ "review" diff --git a/lib/generate/formatContributor.js b/lib/generate/formatContributor.js index e0b667f..4da0de8 100644 --- a/lib/generate/formatContributor.js +++ b/lib/generate/formatContributor.js @@ -5,7 +5,7 @@ var _ = require('lodash/fp'); var formatContributionType = require('./formatContributionType'); var avatarTemplate = _.template('![<%= contributor.name %>](<%= contributor.avatar_url %>)'); -var avatarBlockTemplate = _.template('[<%= avatar %>
<%= contributor.name %>](<%= contributor.html_url %>)'); +var avatarBlockTemplate = _.template('[<%= avatar %>
<%= contributor.name %>](<%= contributor.profile %>)'); var contributorTemplate = _.template('<%= avatarBlock %>
<%= contributions %>'); function defaultTemplate(templateData) {