Writing & Markdown

Toggles

Create collapsible toggle blocks for FAQs, solutions, and hidden content using the Hugo spoiler shortcode.

Usage

{{</* spoiler text="Click to view the spoiler" */>}}
You found me!

Markdown is **supported**.
{{</* /spoiler */>}}

Parameters

ParameterTypeDescription
textstringRequired. The clickable trigger text

The content between the opening and closing tags supports full Markdown.

Examples

FAQ Pattern

{{</* spoiler text="What is Ownable?" */>}}
Ownable is an open-source website builder powered by Hugo.
{{</* /spoiler */>}}

{{</* spoiler text="Is it free?" */>}}
Yes! Ownable is free and open-source.
{{</* /spoiler */>}}

Code Inside

{{</* spoiler text="View the solution" */>}}
```python
def fibonacci(n):
    if n <= 1:
        return n
    return fibonacci(n-1) + fibonacci(n-2)
```
{{</* /spoiler */>}}

Was this page helpful?

From the makers of

© 2026 Lore Labs.

On this page