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

Removes large pypi image in Slack link unfurling #17282

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rmasters
Copy link

@rmasters rmasters commented Dec 14, 2024

One of my pet peeves is that sharing a pypi link in Slack embeds a tall image - this displays at most two pypi links on my 13" screen until the expansion is deleted by the user.

CleanShot 2024-12-14 at 11 28 32@2x

This PR prevents inclusion of the og:image meta tag when the user-agent represents the Slack link unfurler. It keeps the existing images for Twitter and other social network embeds.

Slack Twitter Facebook
Slack preview, without an image Twitter preview, showing an image Facebook preview, with an image

This PR also makes the following changes to the Twitter embed:

  • Declares the card as a summary card, which was preventing some preview tooling from working. I believe this was previously falling back to a summary card by default.
  • Adds @pypi as the site.

It's worth noting that if #2211 is implemented, this should be reverted, ideally with an image height constraint.


Despite it's simplicity, I'm not sure if adding to the project/release view context is the best approach for this. Would you prefer this to be a service?

I'm considering some further expansion to this - adding fields like the github repo link, downloads count and latest release date to the metadata (as seen in this example, using the twitter:label1/twitter:data1 meta properties).

@rmasters rmasters requested a review from a team as a code owner December 14, 2024 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant