Shortcode Example

When writing shortcode's documentation, we usually provide examples and their source code so that users can preview the results, read and copy the code, whereas this would require you to repeat a similar code twice. With this shortcode, you can type in the source code once to achieve this.

On this page

Syntax

1{{< hugo/shortcode-example >}}
2ESCAPED SOURCE CODE HERE.
3{{< /hugo/shortcode-example >}}

Example

Let’s take param as example.

1{{< hugo/shortcode-example >}}
2Title: {{</* param title */>}}
3{{< /hugo/shortcode-example >}}

Result as follows.

1Title: {{< param title >}}
Title: Shortcode Example