Other Shortcodes

ℹ️
Some of these are Hugo built-in shortcodes. These shortcodes are considered less stable and may be changed anytime.

Badge

{{< badge "Badge" >}}

Result:

Badge

Variants:

{{< badge content="info" type="info" >}}
{{< badge content="warning" type="warning" >}}
{{< badge content="error" type="error" >}}

Result:

info
 
warning
 
error

With link and icon:

{{< badge content="Releases" link="https://github.com/imfing/hextra/releases" icon="github" >}}

Result:

Releases

Options

NameDescription
contentThe text of the badge.
linkThe link of the badge.
iconThe icon of the badge.
typeThe type of the badge. (default, info, warning, error)
classThe class of the badge.

YouTube

Embed a YouTube video.

{{< youtube VIDEO_ID >}}

Result:

For more information, see Hugo’s YouTube Shortcode.

PDF

With PDF shortcode, you can embed a PDF file in your content.

{{< pdf "https://example.com/sample.pdf" >}}

You can also place the PDF file in your project directory and use the relative path.

{{< pdf "path/to/file.pdf" >}}

Example:

Last updated on