Geht wählen! Am 26. September 2021 ist Bundestagswahl in Deutschland, wählt Annalena Baerbock für zukunftssichere Klima-, Digital- und Sozialpolitik.. Mehr infos zum Wahlprogramm auf gruene.de 🗳💚🌻

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 caniuse.com and codepen.io 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.

https://mastodon.social/@kevingimbel/100700713283716694

The Source Code can be found on GitHub.com

Configuration

The shortcode is fairly simple and requires only one attribute: The link to a single toot, e.g. https://mastodon.social/@kevingimbel/100700713283716694.

{{ mastodon "https://mastodon.social/@kevingimbel/100700713283716694" }}

Additional parameters:

# All parameters
{{ mastodon "https://mastodon.social/@kevingimbel/100700713283716694" "1000" "500" }}

Below is a short description for each parameter

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

Examples

https://mastodon.social/@rootsworks/100666238685414786 https://mastodon.social/@prashere/539624 https://octodon.social/@spacekookie/100680807257148198

Hi, I'm Kevin!

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

Hand-made vector avatar of Kevin Gimbel

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.