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.
1{{< hugo/shortcode-example >}}
2ESCAPED SOURCE CODE HERE.
3{{< /hugo/shortcode-example >}}
You MUST escape the source code by adding /*
after opening delimiter ({{<
or {{%
) and adding */
before closing delimiter (>}}
or %}}
).
Let’s take param
as example.
1{{< hugo/shortcode-example >}}
2Title: {{</* param title */>}}
3{{< /hugo/shortcode-example >}}
Result as follows.
1Title: {{< param title >}}