Skip to content

Conversation

jonkafton
Copy link
Contributor

What are the relevant tickets?

Description (What does it do?)

Replaces the social media image

How can this be tested?

Load http://open.odl.local:8062/images/learn-og-image.jpg and confirm you see the new image (MIT logo top right as opposed to https://learn.mit.edu/images/learn-og-image.jpg).

We're also now setting the known width and height. You should see the following in the HTML source:

<meta property="og:image:height" content="511">
<meta property="og:image:width" content="967">

Additional Context

I considered providing a new image filename/URL; from gpt-4.1:

"Is it better to replace the image at the same URL?"

Yes, in most cases, it is better to replace the image at the same URL if you want new shares to immediately use the new image and to avoid confusion or broken links.

Here’s why:

  • Social platforms cache the image at the OG image URL. If you keep the URL the same and just update the image file, new shares will eventually show the new image once the cache expires or is manually refreshed.
  • If you change the URL, platforms will treat it as a new image and fetch it immediately for new shares, but old shares will still show the old cached image (or the old URL, which may break if deleted).

Comment on lines +101 to +102
width: image === DEFAULT_OG_IMAGE ? 967 : "",
height: image === DEFAULT_OG_IMAGE ? 511 : "",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Switched as the intention is to provide the dimensions for our known image.

@abeglova abeglova self-assigned this Aug 15, 2025
@jonkafton jonkafton merged commit 39a2f69 into main Aug 15, 2025
13 checks passed
@jonkafton jonkafton deleted the jk/8086-update-og-image branch August 15, 2025 14:25
@odlbot odlbot mentioned this pull request Aug 15, 2025
4 tasks
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.

2 participants