Mastodon Embed Shortcode for hugo

Written by Kevin Gimbel on , 🍿 1 min. read

This website no longer uses Hugo. The Mastodon embed doesn't work as of January 2021 and I'm not sure if I'll implement it again for 11ty, the new static site generator used for this website.

For this reason, the embed examples in this post do not work.

You may know that I made some shortcodes for Hugo, the static site generator I am using to create this website. So far I made a shortcode for and which allow to embed CodePen and "Can I Use" embeds easily with Hugos build-in Shortcode system.

Today I made another one which allows embeds from Mastodon, the decentralized Twitter-like social network. An example embed is shown below.

The Source Code can be found on


The shortcode is fairly simple and requires only one attribute: The link to a single toot, e.g.

{{ mastodon "" }}

Additional parameters:

# All parameters
{{ mastodon "" "1000" "500" }}

Below is a short description for each parameter

statusThe link to the status
widthThe width of the iframe
heightThe height of the iframe


Hi, I'm Kevin!

I'm a DevOps Engineer with a passion for on automation and monitoring. Before shifting into DevOps and cloud computing I worked as Front-End Developer, which is still a hobby and field of interest for me.

Picture of Kevin Gimbel, in a tiny mirror

I'm very passionated about a variety of games - digital, boardgames, and pen & paper; and also interested in Sci-Fi, Cyberpunk, and dystopian books. You can find out more on the about page.