Set the image used for social network sharing?

When working on adding this feature I caught a bug. I noticed that right now here is how we prioritize OpenGraph image: first post image > opengraph_image > twitter_summary_large_image_url > site_apple_touch_icon_url.

And https://discourse.codinghorror.com did had the site_apple_touch_icon_url so the twitter:image tag was present <meta name="twitter:image" content="/images/default-apple-touch-icon.png" />.

Turns out Twitter does not support relative image paths. This is now fixed via:

https://github.com/discourse/discourse/commit/f83533e1cb5ff262cb25d9392bc2dcc1621fb0ab

Above commit also adds logo_url as last resort for OpenGraph/Twitter image tag. This updates opengraph image priority to: first post image > opengraph_image > twitter_summary_large_image_url > site_apple_touch_icon_url > logo_url.

Verified the fix on https://discourse.codinghorror.com:

ch

7 Likes