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

Add twitter card metadata #459

Merged
merged 4 commits into from
Feb 16, 2024
Merged

Add twitter card metadata #459

merged 4 commits into from
Feb 16, 2024

Conversation

rjwignar
Copy link
Collaborator

This fixes #432.

Summary

Testing Requirements?

I am going to run the generated preview against the Twitter Card Validator.
I hope the validator can test the preview website

@rjwignar rjwignar self-assigned this Feb 16, 2024
@rjwignar rjwignar added this to the Release 1.3 milestone Feb 16, 2024
Copy link

cloudflare-pages bot commented Feb 16, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7ca66d0
Status: ✅  Deploy successful!
Preview URL: https://038a0b88.console-overthinker-dev.pages.dev
Branch Preview URL: https://rjwignar-issue-432.console-overthinker-dev.pages.dev

View logs

@rjwignar
Copy link
Collaborator Author

rjwignar commented Feb 16, 2024

Test Results

It looks like Twitter detects the tags now when I run https://rjwignar-issue-432.console-overthinker-dev.pages.dev/c/vst_bZGotyMpzM2e0ZcHz against it,
image

This is what the card looks like in the preview:
image

Problem

Our image doesn't appear on the Card. I think our image dimensions are too small (32x32).
The Summary Card supports minimum image dimensions of 144x144:
image

The Summary Card with Large Image
supports minimum image dimensions of 300x157:
image

@humphd
Copy link
Collaborator

humphd commented Feb 16, 2024

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.

Copy link
Collaborator

@humphd humphd left a 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?

// Set various types of titles/summaries

Copy link
Collaborator

@kliu57 kliu57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested on twitter with the preview url, works well.

image

@rjwignar
Copy link
Collaborator Author

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:
image

Here's what it looks like in the Tweet Composer (using summary_large_image):
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.

TODO in followup: Modify twitter:image meta tags to use screenshot of final message.

@rjwignar rjwignar merged commit ca5ef70 into main Feb 16, 2024
4 checks passed
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.

Add twitter card metadata
3 participants