Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish the 2020 contributors page #1020

Closed
rviscomi opened this issue Jul 14, 2020 · 6 comments · Fixed by #1024
Closed

Publish the 2020 contributors page #1020

rviscomi opened this issue Jul 14, 2020 · 6 comments · Fixed by #1024
Assignees
Labels
development Building the Almanac tech stack

Comments

@rviscomi
Copy link
Member

I'd love to see the /<lang>/2020/contributors page published so we can highlight everyone who has already signed up. I think it would also be really interesting from the reader's perspective to get an early glimpse of this year's author lineup, and maybe encourage new contributors to join.

I'm open to ideas for what to do with the "join the team" link. In the 2019 version we can remove it since we're no longer collecting form submissions, redirect the link to come to this repo's README, or something else. For the 2020 page, it can link to the README.

The link to the page should be added to the header/footer and the page itself should reuse the same template and translations from 2019.

@rviscomi rviscomi added the development Building the Almanac tech stack label Jul 14, 2020
@rviscomi rviscomi added this to the 2020 Platform Development milestone Jul 14, 2020
@rviscomi rviscomi self-assigned this Jul 14, 2020
@rviscomi
Copy link
Member Author

I wrote this util script to help extract the contributor metadata from their GitHub profile page:

function getContributorConfig(teams) {
    const config = {};
    config.name = document.querySelector('.p-name').innerText;
    config.teams = teams;
    const avatar_id_regex = /githubusercontent.com\/u\/(\d+)?/;
    const avatar_id = document.querySelector('main img.avatar-user').src.match(avatar_id_regex)[1];
    config.avatar_url = `https://avatars1.githubusercontent.com/u/${avatar_id}?v=4&s=200`;
    const websiteElement = document.querySelector('.vcard-detail[itemprop="url"]');
    if (websiteElement) {
        config.website = websiteElement.innerText;
    }
    config.github = document.querySelector('.p-nickname').innerText;
    const twitterElement = document.querySelector('.vcard-detail[itemprop="twitter"]');
    if (twitterElement) {
        config.twitter = twitterElement.innerText.substr(1);
    }
    return `"${config.github}": ${JSON.stringify(config, null, 2)}`;
}

Then from the console I call it like this:

copy(getContributorConfig(['authors']))

Here's an example of the output for my profile:

"rviscomi": {
  "name": "Rick Viscomi",
  "teams": [
    "authors"
  ],
  "avatar_url": "https://avatars1.githubusercontent.com/u/1120896?v=4&s=200",
  "github": "rviscomi",
  "twitter": "rick_viscomi"
}

With this, it's easy to generate a new contributor config and paste it into 2020.json.

@tunetheweb
Copy link
Member

I'm open to ideas for what to do with the "join the team" link. In the 2019 version we can remove it since we're no longer collecting form submissions, redirect the link to come to this repo's README, or something else. For the 2020 page, it can link to the README.

I say leave it in 2019 version. People are still welcome to join us at any time. Just update like to README - same as for 2020.

@rviscomi
Copy link
Member Author

I've pushed my initial batch of contributors in this commit: ff11cd0. Passing it off to @bazzadp.

@ibnesayeed
Copy link
Contributor

@rviscomi forward slashes were escaped in URIs (e.g., avatar_url), but what you generate with your script does not escape them. Besides, I was wondering why do we need to escape them in the first place?

@tunetheweb
Copy link
Member

Was just wondering that myself as works without escaping them!

Googled and found this: https://stackoverflow.com/questions/1580647/json-why-are-forward-slashes-escaped

So you don't have to. Tempted to remove them to make it more readable as tested and site works fine without them.

@ibnesayeed
Copy link
Contributor

So you don't have to. Tempted to remove them to make it more readable as tested and site works fine without them.

Searched for instances where avatar_url is being used in this repo and do not see anything tricky where not escaping might cause any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Building the Almanac tech stack
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants