-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add twitter card metadata #459
Conversation
Deploying with Cloudflare Pages
|
Test ResultsIt looks like Twitter detects the tags now when I run https://rjwignar-issue-432.console-overthinker-dev.pages.dev/c/vst_bZGotyMpzM2e0ZcHz against it, This is what the card looks like in the preview: ProblemOur image doesn't appear on the Card. I think our image dimensions are too small (32x32). The Summary Card with Large Image |
In a follow-up, I'd like to see us take a screenshot of the final message, and upload that along with the chat when we share, and we could use it as our image. For now, no image is fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good start.
But can you add it to the share logic too?
chatcraft.org/src/lib/share.ts
Line 59 in 4016e91
// Set various types of titles/summaries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested Twitter meta tags in shared chat, https://rjwignar-issue-432.console-overthinker-dev.pages.dev/api/share/chatcraft_dev/BD3ThijHaa5gfs51H0JEN, against Twitter Card validator and it passes: Here's what it looks like in the Tweet Composer (using summary_large_image):
TODO in followup: Modify twitter:image meta tags to use screenshot of final message. |
This fixes #432.
Summary
og:type
property.From https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup,
A Twitter Summary card can be rendered if an
og:type
,og:title
andog:description
exist but nottwitter:card
, but I ended up also adding required Twitter meta tags for robustness.Testing Requirements?
I am going to run the generated preview against the Twitter Card Validator.
I hope the validator can test the preview website