Details
New in v0.140.0
Example
With this markup:
{{< details summary="See the details" >}}
This is a **bold** word.
{{< /details >}}
Hugo renders this HTML:
<details>
<summary>See the details</summary>
<p>This is a <strong>bold</strong> word.</p>
</details>
Which looks like this in your browser:
See the details
This is a bold word.
Arguments
- summary
- (
string
) The content of the childsummary
element rendered from Markdown to HTML. Default isDetails
. - open
- (
bool
) Whether to initially display the content of thedetails
element. Default isfalse
. - class
- (
string
) Theclass
attribute of thedetails
element. - name
- (
string
) Thename
attribute of thedetails
element. - title
- (
string
) Thetitle
attribute of thedetails
element.
Styling
Use CSS to style the details
element, the summary
element, and the content itself.
/* target the details element */
details { }
/* target the summary element */
details > summary { }
/* target the children of the summary element */
details > summary > * { }
/* target the content */
details > :not(summary) { }