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

fix: Fix Card Click Behavior for Pinned Repos and Gists #3955 #3961

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sagarbendale2004
Copy link

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!

Copy link

vercel bot commented Oct 1, 2024

@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.

@github-actions github-actions bot added repo-card Issues related to the pin/repo card. gist-card labels Oct 1, 2024
@sagarbendale2004
Copy link
Author

@anuraghazra please review my changes, i solved this particular issue very well. and please merge my pull request as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gist-card repo-card Issues related to the pin/repo card.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant