fix: Fix Card Click Behavior for Pinned Repos and Gists #3955
Description
This pull request addresses an issue with the click behavior of the cards for pinned repositories and gists. Previously, clicking on a card resulted in the user being directed to a URL that displayed an image of the card rather than the intended repository or gist page. This behavior made the pinned cards unusable as a replacement for the native pins, which should allow users to navigate directly to the relevant GitHub pages.
Changes Made -
Wrapped the card rendering code in an anchor () tag, enabling users to click on the card and be redirected to the corresponding repository or gist page. The implementation ensures that the link opens in a new tab while maintaining security best practices by using rel="noopener noreferrer"
<a href="https://github.com/${nameWithOwner}" target="_blank" rel="noopener noreferrer">
// This anchor tag links to the GitHub repository or gist for the card
${card.render(`...`)}
`)}
</a>
Expected Behavior-
With this change, clicking on a card for a repository or gist now properly directs users to the respective page on GitHub. This enhances usability and aligns with the expected functionality of native pinned repositories.
I appreciate your consideration of this pull request, and I look forward to any feedback you may have!
@sagarbendale2004 is attempting to deploy a commit to the github readme stats Team on Vercel.
A member of the Team first needs to authorize it.
@anuraghazra please review my changes, i solved this particular issue very well. and please merge my pull request as soon as possible.