Expand
Warning
This shortcode is deprecated in favor of Hugo’s details shortcode. See migration instructions below.
The examples on this page were removed.
The expand shortcode displays an expandable/collapsible section of text.
Migration
While this shortcode will still be available for some time, it does not receive support anymore. Start to migrate early, as it will be removed with the next major update of the theme.
Each use of the expand shortcode issues a warning during the build.
The details shortcode displays the same section but is called differently. A call can not just be renamed.
expand |
details |
|---|---|
title or first parameter |
summary |
expanded or second parameter |
open |
{{% expand %}} |
{{< details >}} |
{{< expand >}} |
{{< details raw=true >}} |
- The
detailsshortcode takes no positional parameters. Name them. - Don’t keep
title. Thedetailsshortcode knows this parameter too, but displays it as a tooltip. Your section would silently be titledDetails. - Call the
detailsshortcode with{{< details >}}. It renders its content as Markdown in this notation, where theexpandshortcode wrote it as it is. - If you called the
expandshortcode with{{< expand >}}, your content is HTML or contains other shortcodes. Setraw=trueto keep it written as it is. - The content of the
detailsshortcode is rendered apart from the rest of your page. If it defines footnotes, contains headings or calls other shortcodes, see the consequences.
If you call the shortcode from your own partials, rename shortcodes/expand.html to shortcodes/details.html, rename the parameters as above and set raw to true if your content is HTML already.
Usage
Parameters
| Name | Position | Default | Notes |
|---|---|---|---|
| title | 1 | "Details" |
Arbitrary text to appear next to the expand/collapse icon. |
| expanded | 2 | false |
How the content is displayed. - true: the content is initially shown- false: the content is initially hidden |
| <content> | <empty> | Arbitrary text to be displayed on expand. |