Spoiler shortcodes (also known as "cut tags") allow you to write text that some users may not want to see and hide until the reader chooses to see it.
spoiler.css
and spoiler.js
on your site via modification of <head>
tag or with your theme properties.<head>
tag.
For example, <script src="https://github.com/akuznecov/hugo-shortcode-spoiler/raw/master//cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js"></script>
Syntax is quite basic
https://gohugo.io/content-management/shortcodes/#shortcodes-without-markdown
{{< spoiler >}}
Hidden content!
{{< /spoiler >}}
https://gohugo.io/content-management/shortcodes/#shortcodes-with-markdown
{{% spoiler %}}
- Hidden
- **content**
{{% /spoiler %}}
{{< spoiler >}}
Foo
{{% spoiler %}}
Bar
{{% /spoiler %}}
{{< /spoiler >}}
{{% spoiler text="Foo" %}}
`bar`
{{% /spoiler %}}