Shortcodes

Hugo specific shortcodes for embedding content.

Contents

Introduction

Most of the updated content for the Hugo site should just be standard markdown prefaced with the Hugo Front Matter section.

However Hugo also has a number of options outside of the markdown standard. Some of the most common are listed below.

Shortcodes

The Hugo shortcodes are very useful for embedding tweets, Instagram posts, Vimeo videos, etc.

Youtube

Example HTML:

<iframe width="560" height="315" src="https://www.youtube.com/embed/UKBp7LID-go?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

Hugo Shortcode:

{{< youtube id="UKBp7LID-go" >}}

Example:

You can also add autoplay="true" as an additional argument.

Gist

You can add in your GitHub Gists. Great for logs, small scripts etc.

Source Gist:

https://gist.github.com/richeney/ff7850d83d394ef4213c24f53bbfaf02

Hugo Shortcode:

{{< gist richeney ff7850d83d394ef4213c24f53bbfaf02 >}}

Example:


Help us improve

Azure Citadel is a community site built on GitHub, please contribute and send a pull request

Make a change