rahuldkjain/github-profile-readme-generator

Add more Github Stats options for user to choose

Open

#40 opened on Jul 27, 2020

View on GitHub
 (4 comments) (0 reactions) (1 assignee)JavaScript (5,899 forks)batch import
enhancementhacktoberfestv1-deprecated

Repository metrics

Stars
 (19,657 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

anuraghazra/github-readme-stats project that provides GitHub Stats Card now widely used in many profile-readme github has 2 more card namely:

  • GitHub Extra Repo Pins
  • Top Languages Card

So adding this feature request so that user can get an option to add this data in his profile-readme

Solution - Adding 2 more checkbox option for the user to select whether he wants to add these functionalities:

  • If user selects Top Languages Card:
    const GithubTopLanguagesUsed = (props) => {
        let link = "https://github-readme-stats.vercel.app/api/top-langs/?username=" + props.github + "&hide_langs_below=1&layout=compact"
        if (props.show) {
            return (<>{`<p align="center"> <img src="${link}" alt="${props.github}" /> </p>`}<br /><br /></>);
        }
        return '';
    }

<><GithubTopLanguagesUsed show={props.data.githubStats} github={props.social.github} /></>
  • If user selects GitHub Extra Repo Pins: Add 2 repo links and show them one along side another
    const MostAdmiredRepos = (props) => {
        let html = `
## Most Admired Repos

<a href="https://github.com/${props.github}/${props.repo[0]}">
  <img align="center" src="https://github-readme-stats.vercel.app/api/pin/?username=${props.github}&repo=${props.repo[0]}" />
</a>
<a href="https://github.com/${props.github}/${props.repo[1]}">
 <img align="center" src="https://github-readme-stats.vercel.app/api/pin/?username=${props.github}&repo=${props.repo[1]}" />
</a>`

        if (props.show) {
            return (<>{`${mostAdmiredRepos}`}<br /><br /></>);
        }
        return '';
    }

<><MostAdmiredRepos show={props.data.githubStats} github={props.social.github} repos={props.github.repos}/></>

Contributor guide