aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorJoe Mooring <[email protected]>2024-12-13 03:25:10 -0800
committerBjørn Erik Pedersen <[email protected]>2024-12-13 14:21:13 +0100
commit1e34e5b26d12e470473064b2825f9bbaa2d66c36 (patch)
treea0ec5ea345fad29bf069e6dc560304a7eda347e7 /docs
parent641d2616c71dfff4afa5ab09711c5b45a2a18131 (diff)
downloadhugo-1e34e5b26d12e470473064b2825f9bbaa2d66c36.tar.gz
hugo-1e34e5b26d12e470473064b2825f9bbaa2d66c36.zip
tpl/tplimpl: Update details shortcode
- Remove localization of default summary value - Add title attribute - Reformat to be consistent with other embedded templates - Simplify and improve integration test - Update documentation
Diffstat (limited to 'docs')
-rw-r--r--docs/content/en/content-management/shortcodes.md32
1 files changed, 21 insertions, 11 deletions
diff --git a/docs/content/en/content-management/shortcodes.md b/docs/content/en/content-management/shortcodes.md
index 7a589a340..47e4f94ed 100644
--- a/docs/content/en/content-management/shortcodes.md
+++ b/docs/content/en/content-management/shortcodes.md
@@ -101,32 +101,42 @@ Although you can call this shortcode using the `{{</* */>}}` notation, computati
{{% note %}}
To override Hugo's embedded `details` shortcode, copy the [source code] to a file with the same name in the layouts/shortcodes directory.
-This may be useful if you are wanting access to more global HTML attributes.
-
[source code]: {{% eturl details %}}
{{% /note %}}
-Use the `details` shortcode to generate a collapsible details HTML element. For example:
+Use the `details` shortcode to create a `details` HTML element. For example:
```text
-{{</* details summary="Custom Summary Text" */>}}
-Showing custom `summary` text.
+{{</* details summary="See the details" */>}}
+This is a **bold** word.
{{</* /details */>}}
```
-Additional examples can be found in the source code. The `details` shortcode can use the following named arguments:
+Hugo renders this to:
+
+```html
+<details>
+ <summary>See the details</summary>
+ <p>This is a <strong>bold</strong> word.</p>
+</details>
+```
+
+The details shortcode accepts these named arguments:
summary
-: (`string`) Optional. Specifies the content of the child summary element. Default is "Details"
+: (`string`) The content of the child `summary` element rendered from Markdown to HTML. Default is `Details`.
open
-: (`bool`) Optional. Whether to initially display the contents of the details element. Default is `false`.
+: (`bool`) Whether to initially display the content of the `details` element. Default is `false`.
+
+class
+: (`string`) The value of the element's `class` attribute.
name
-: (`string`) Optional. The value of the element's name attribute.
+: (`string`) The value of the element's `name` attribute.
-class
-: (`string`) Optional. The value of the element's class attribute.
+title
+: (`string`) The value of the element's `title` attribute.
### figure