I wrote a simple custom alt-text shortcode for my blog that adds an “alt-text” button to images that displays a modal with the media description when clicked. This feature seems to be very common Mastodon web and mobile clients like Phanpy and Ice Cubes, both of which I use and can highly recommend.

The following markdown snippet renders an image with a clickable “ALT” button in the bottom left (additional spaces added between curly and angle brackets so it gets treated as text).

{{ < alt-text src="/images/example.jpg" description="Media description that appears when users click the ALT button" > }}
Screenshot of a slide showing a signed git commit output from git log and an image of a verified commit in GitHub. The image is rendered with the custom alt-text shortcode that renders an ALT button in the bottom left of the image.
A modal showing the media description of an image when the ALT button is clicked.

Check out the source code and installation instructions on GitHub and you can find me on Mastdon at @[email protected].