Hugo Shortcodes

Shortcodes are simple snippets inside your content files calling built-in or custom templates.

Built-in Shortcodes

figure

HTML5 <figure> element.

gist

Bloggers often want to include GitHub gists when writing posts.

highlight

This shortcode will convert the source code provided into syntax-highlighted HTML.

instagram

If you’d like to embed a photo from Instagram, you only need the photo’s ID.

param

Gets a value from the current Page’s params set in front matter, with a fall back to the site param value.

ref and relref

These shortcodes will look up the pages by their relative path.

tweet

You want to include a single tweet into your blog post? Everything you need is the URL of the tweet.

vimeo

Adding a video

youtube

Adding a video

Custom Shortcodes

You can extend Hugo’s built-in shortcodes by creating your own using the same templating syntax as that for single and list pages.

{ {< lottie logo-olympics >} }