Open RKonstantinR opened 1 year ago
https://oostens.me/posts/hugo-shortcodes-with-markdown-gotchas/ geekdoc has a good expand shortcode that can be used for this... but it comes with some interesting caveats.
IIUC this should be pretty trivial with Tailwind. We can do something like the examples here.
I would like to say this is quite similar to the Alert shortcode, so I'd like to focus on making collapsible sections.
I'd like to tack on a possible syntax which follows the style of the Alert shortcode (using % because Markdown > HTML and renderer.unsafe
is enabled, not sure if using Markdown here is practically feasible though):
{{% callout title="Your Title" icon="none (or an icon)" open="true/false" background="true/false" color="#000000" iconColor="#000000" textColor="#000000" %}}
**block content**
{{% /callout %}}
open
specifies whether or not the callout is collapsed by default.
If no text color is specified, follow the default text color which also respects the theme.
If a background is specified it's like a collapsible Alert shortcode.
If no background is specified do an outline style a-la the Series feature but with a thicker body border:
Describe the solution you'd like Create a shortcode to insert callout blocks that the user can expand. It would be nice to add additional attributes like: collapse="true" to make it collapse by default, or collapse="false" to make the callout a collapsible that expands by default.
Describe alternatives you've considered Something like shortcode in loveit theme
Additional context Example: https://quarto.org/docs/authoring/callouts.html