Tangible Bytes

Where Code Meets Reality

Hugo Shortcode

I wanted to use an html <aside> block in my blog and this isn’t supported by Markdown

It’s fairly easy to implement as a hugo shortcode though

I created a file (path from the root of my hugo site)

layouts/shortcodes/aside.html

<aside>
  {{/* .Inner | markdownify */}}
</aside>

Then in my markdown content

{{< aside >}}

This is an aside

{{< /aside >}}

and with the help of some CSS it looks like this (with an actual aside as I go down another rabbithole)


Get in touch

If you liked this article, or didn't. If you see any errors, or want to say thanks.

Contact me on twitter @tangiblebytes