Mastodon Embed Shortcode for hugo

Published on 09/12/2018 | 12.09.12018 HE

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.

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 status="https://mastodon.social/@kevingimbel/100700713283716694" >}}

Additional parameters:

# All parameters
{{< mastodon status="https://mastodon.social/@kevingimbel/100700713283716694" width="1000" height="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

Categories

Tags

Like this?

This website contains no advertisement, no tracking, no paid articles, and no shady-things-whatsoever. It is just content, provided free of charge and with accessibility in mind.

If you would like to support me in providing content - and code - for free or if this page has helped you or your company, consider supporting me directly.

You can support me via:

A colorful image of me wearing my DIY mask. The image has a colorful glitch effect.

Kevin Gimbel

is a DevOps Engineer and avid (Video) Gamer. He’s also interested in Sci-Fi, Cyberpunk, and dystopian books.

Wearing a mask is a good idea!

You can find out more about me if you wish.