Collapse Shortcode

The collapse shortcode allows you to create expandable/collapsible sections in your content without JavaScript.

Usage

GO
1
2
3
{{< collapse title="Click to expand" open="false" >}}
This content will be hidden initially and displayed when the summary is clicked.
{{< /collapse >}}

Parameters

ParameterRequiredDefaultDescription
titleNoClick to expandText displayed on the clickable summary
openNofalseWhether the collapse section is open by default (`true` or `false`)
Inner contentYes-The content inside the collapse block, supports Markdown
Table: Collapse Shortcode Parameters

Examples

Basic Collapse (Closed by Default)

Click to expand
This content is hidden until you click the summary.

Collapse Open by Default

Read me
This content is visible by default.

Using Markdown Inside Collapse

Markdown Example
  • Item 1
  • Item 2
  • Bold text and italic text
1
print("Hello inside collapse")