From c9b23cf6dc7c7aba75b8e48fd0cec9aec949a2e9 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Fri, 13 Dec 2024 03:25:10 -0800 Subject: [PATCH] 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 --- content/en/content-management/shortcodes.md | 32 ++++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/content/en/content-management/shortcodes.md b/content/en/content-management/shortcodes.md index 7a589a3400..47e4f94ed0 100644 --- a/content/en/content-management/shortcodes.md +++ b/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 -{{}} -Showing custom `summary` text. +{{}} +This is a **bold** word. {{}} ``` -Additional examples can be found in the source code. The `details` shortcode can use the following named arguments: +Hugo renders this to: + +```html +
+ See the details +

This is a bold word.

+
+``` + +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