Hi there! Internet Explorer is no longer supported.

Please use a modern web browser such as Firefox, Chromium or Edge. Thank you!

Shortcodes

Bundled Trigo Theme and Hugo shortcodes to augment your content with custom stuff.

a cover alternative title
a cover caption

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

Trigo provides a collection of shortcodes to enhance your content. Additional shortcodes are provided directly by Hugo (see the last ones).

Details shortcode

Trigo shortcode to display a collapsible content.

Example

Details

This is the content of the details.

Markdown is supported.

Click me to reveal

This will be hidden by default.

Usage

markdown
{{< details summary="Details" >}}

This is the content of the details.

Markdown is **supported**.

{{< /details >}}
markdown
{{< details summary="Click me to reveal" open="false" >}}

This will be hidden by default.

{{< /details >}}

Tabs shortcode

Trigo shortcode to display content is several tabs.

Example

JSON: JavaScript Object Notation (JSON) is a standard text-based format for representing structured data based on JavaScript object syntax.

{ "hello": "world" }

YAML: YAML is a human-readable data serialization language.

hello: world

TOML: TOML aims to be a minimal configuration file format that’s easy to read due to obvious semantics.

hello = "world"

Usage

markdown
{{< tabs >}}

  {{< tab JSON >}}
  **JSON**: JavaScript Object Notation (JSON) is a standard text-based format for representing structured data based on JavaScript object syntax.
  ```json
  { "hello": "world" }
  ```
  {{< /tab >}}
  {{< tab YAML >}}
  **YAML**: YAML is a human-readable data serialization language.
  ```yaml
  hello: world
  ```
  {{< /tab >}}
  {{< tab TOML >}}
  **TOML**: TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics.
  ```toml
  hello = "world"
  ```
  {{< /tab >}}

{{< /tabs >}}

Steps shortcode

Trigo shortcode to display a series of steps.

You can use the Markdown attribute {class="no-step"} to prevent a heading from being counted as a step.

Example

Step 1

This is the first step.

Step 2

This is the second step.

Step subheading

This will not be counted as a step.

Step 3

This is the third step.

Usage

Warning

Please note that this shortcode is intended only for Markdown content. If you put HTML content or other shortcodes as step content, it may not render as expected.

markdown
{{% steps %}}

#### Step 1

This is the first step.

#### Step 2

This is the second step.

###### Step subheading {class="no-step"}

This will not be counted as a step.

{{% /steps %}}

Tree shortcode

Trigo shortcode to display a filetree with branches and leaves.

Example

Usage

markdown
{{< tree name="example" style="border: var(--border);" >}}
  {{< branch name="content" >}}
    {{< leaf name="_index.md" >}}
    {{< branch name="docs" state="closed" >}}
      {{< leaf name="_index.md" style="color: red;" >}}
      {{< leaf name="introduction.md" >}}
      {{< leaf name="introduction.fr.md" >}}
    {{< /branch >}}
  {{< /branch >}}
  {{< leaf name="hugo.toml" >}}
{{< /tree >}}

Options

branch

ParameterDescription
nameThe name of the branch.
typeThe type of the branch. Can be folder, document, container, group, part, assembly, arrow, branch, fork, or merge. Default is folder.
stateThe state of the branch: can be open or closed. Default is open.

Trigo shortcode to display a carousel of images with drag, scroll support and optional automatic mode.

Example

Usage

Specify a directory where all image resources are used for the carousel:

markdown
{{< carousel dir="path/to/directory" mode="auto" >}}

Specify a list of images to use with an images parameter:

markdown
{{< carousel images="1.webp, 2.webp, 3.webp" >}}

Specify a list of images to use:

markdown
{{< carousel "1.webp" "2.webp" "3.webp" >}}

The path is relative to the current page bundle. To use resources in the static or assets directories of the site, prefix the path with a / slash. The URL of an external image can be use as well.

Compare

Trigo shortcode to display two stacked images with a movable vertical clipping path.

Example

CompareCompare

Usage

Specify two image paths:

markdown
{{< compare "1.webp" "2.webp" >}}

The path is relative to the current page bundle. To use resources in the static directory of the site, prefix the path with a / slash. The URL of an external image can be use as well.

PDF

Trigo shortcode to display a PDF file.

Example

Usage

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

The PDF file can also be located in the project directory and use the relative path.

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

YouTube

Note

These are Hugo built-in shortcodes. They may be changed anytime. See Hugo Documentation.

Embed a YouTube video.

Example

Usage

markdown
{{< youtube id="VIDEO_ID" loading="lazy" >}}

For more information, see Hugo’s YouTube Shortcode.