Tweets not showing images?


(Bart) #1

Hi,

I’m trying to understand why tweets won’t show the first image from my post. I suspect I’ve got a setting wrong somewhere, but I can’t figure it out.

To demonstrate, here is an original discourse post:

And here’s a tweet with a link to this post. It shows a placeholder image - not even my site logo.

Here’s a test I did with a link to another Discourse instance - as you can see it correctly features the first image.

Is there some settings magic I need to apply to get this to work?

On a related note, is there a way to change the card format to ‘Summary Card with Large Image’? Since we’re running a graphics-oriented community this would make sense for us.


(Jeff Atwood) #2

You must configure the twitter API keys in your site settings for this to work as I recall.


(Bart) #3

Hmm, we haven’t done that on the Sketchfab forum, which shows the images correctly. My hunch is that I’ve misconfigured something else. Also, I think the only available Twitter settings are for authentication?


(Arpit Jalan) #4

The Twitter Card Validator is showing this warning for the linked post:

WARN:  The image URL https://forum-test.blendernation.com/uploads/default/optimized/1X/236bbbe9fa50f882fc710f078b22276a6cb3b974_1_690x483.jpg specified by the 'twitter:image' metatag may be restricted by the site's robots.txt file, which will prevent Twitter from fetching it.

Testing this meta topic however looks good on the validator.


(Arpit Jalan) #6

Okay, I can verify that fresh Discourse installs are not loading image previews on Twitter.

This was regressed 24 days ago in:

Should we revert this commit @codinghorror?


(Jeff Atwood) #7

Sure that seems fine. You might ping that user I think he posted here about it.


(Arpit Jalan) #8

Okay, that commit is now reverted. I couldn’t find Dan’s account here on meta, but I left the comment on PR.

Thanks for bringing this issue to our notice @bartv. :+1:


(Bart) #9

Wow that’s very fast indeed! So can I now rebuild + test, or is there something else you guys need to do before this fix is available?


(Arpit Jalan) #10

You will have to wait for commit to land in tests-passed branch.


(Arpit Jalan) #11

The commit is now landed in tests-passed branch and I verified that the issue is fixed now.


(Arpit Jalan) #12