DEV Community

Cover image for Make Your Website Social Media Card-able on Twitter, Facebook and More

Make Your Website Social Media Card-able on Twitter, Facebook and More

Rana Emad on July 11, 2020

We all want our websites to be shared on Twitter, Facebook and all the different channels of social media. Whether they are our own websites that h...
Collapse
 
sarehprice profile image
Sarah Price

This is a great tutorial on how to build these! Thanks for putting this together.

Collapse
 
ranaemad profile image
Rana Emad

Thank you for your lovely words and for taking the time to read it!

Collapse
 
waylonwalker profile image
Waylon Walker

Is there any reason for cards to render sometimes, and sometimes not? For instance mine render fine on mobile, but without the summary image on desktop.

What if a summary image is updated after the fact, can it be reflected on the platforms?

I literally posted this minutes before finding your post

Collapse
 
waylonwalker profile image
Waylon Walker • Edited

If it helps, here is an example image that is not showing up... It appears to be within the limits you outline.

summary image

Collapse
 
ranaemad profile image
Rana Emad

First, let me compliment your very cool cards! I am loving the colors and the design!
Second, I haven't faced an issue where the card works on one device and fails on another. It either works for all or fails for all for me, so I blame it on your browser. I have checked the mentioned tweet on 2 different laptops and multiple browsers and it seems to render fine.
waylon card with the issue
Finally, regarding the image update, yes, sometimes an issue arises and the cards are not updated because Twitter caches the card data once it is shared, so to let Twitter know we have new data, we put the same link multiple times in the validator until we view the changes and consequently it will update the cache. If that didn't work there is a work around where we can use a URL shortener like bit.ly and generate a new link, so it will see it for the first time and fetches it with the new data all over again. If all fails, then try to modify the image link in the og tag itself by adding a dummy parameter at the end to try and trick Twitter into thinking it is a new image and repeat the mentioned process until it updates.
I hope this helps. How about you give it another try with the mentioned methods and keep me posted with the progress, maybe we'll figure something out together?

Thread Thread
 
waylonwalker profile image
Waylon Walker

Thanks for the compliments, that means so much to me!!! I spent months tweaking card designs until I ended up on one that I liked enough to keep using for every post.

I Finally figured out the rendering issue... Data Saver. I can't tell you how many hours I have wasted due to this issue, that wasn't even an issue!! I was hoping to keep a pinned tweet with an always up to date post, looks like that is not possible.

I have given it a few days. Tried the card validated multiple times. It seems that cards generated with a redirect cannot be updated.

Thread Thread
 
ranaemad profile image
Rana Emad

Yaaay! I'm glad you figured it out! Sorry you had to find out it's the evil data saver's fault the hard way, though. Thank you for sharing the updates with me, I know these things can be frustrating and you probably saved my future self from going through the same loop. Good luck with your next post!

Collapse
 
perpetual_education profile image
perpetual . education

Great post! We wrote a post about metadata - with some real-world examples of how this could be a make-it-of-break-it situation for some marketing campaigns: dev.to/perpetual_education/metadat...

Collapse
 
ranaemad profile image
Rana Emad

Lovely! Keep up the good work!

Collapse
 
atulcodex profile image
🚩 Atul Prajapati 🇮🇳

Thanks for the amazing trick 💛💐

Collapse
 
ranaemad profile image
Rana Emad

Thank you for your kind words!

Collapse
 
sharadcodes profile image
Sharad Raj (He/Him)

Love it

Collapse
 
ranaemad profile image
Rana Emad

Thank you, Sharad! I am so glad you do!