Native Shortcodes
Hugo has several built-in shortcodes.
Lets go over them here:
- Gist
- Takes the user and gist ID as parameters and renders a GitHub gist. You can also pass a filename if the gist has multiple files.
- Ref
- Takes a file path in the Hugo website and provides an absolute link to that file. If the url or slug is overridden in the front matter of a page, the ref shortcode follows the newly provided location.
- Relref
- Provides the relative link to the file in the Hugo website.
- Figure
- Renders an image with a caption.
- Tweet
- Renders a Tweet with the given ID.
- Embeds an Instagram image with the given ID.
- Vimeo
- Renders a Vimeo video with the given ID.
- Youtube
- Renders a YouTube video with the given ID.
- Highlight
- Adds syntax highlighting for the provided source code.
- Param
- Prints a passed parameter (useful for debugging purposes as well).