Shannon's Hatchet

something, but almost nothing

Thursday, April 30, 2026

Mastodon Cards

For quite some time I’ve been trying, and until just now failing, to get Mastodon to display preview images for my blog posts. It seemed to me that all I had to do was add the proper OpenGraph og:type, og:title, and og:image tags, right? Right?

And then if I check it with one of the numerous preview checkers, and I see the image, it ought to work, right? Right?

No! It doesn’t work that way. This page is a test to see if I was missing something in particular. Maybe it was the lack of og:url (which is required given the spec)? Maybe og:description? Maybe og:image:alt?

And the winner is: og:url, which isn’t that surprising since as the spec says:

og:url - The canonical URL of your object that will be used as its permanent ID in the graph, e.g., “https://www.imdb.com/title/tt0117500/".

But you should add og:image:alt and og:description too, as it is the kind and loving thing to do.