add shortcode for collapsable section

This commit is contained in:
Balakrishnan Balasubramanian 2024-07-05 02:05:55 -04:00
parent d2a3d53e54
commit f3c98b3e46
2 changed files with 19 additions and 0 deletions

View File

@ -10,3 +10,13 @@ asciinema: true
{{< asciinema key="demo" >}} {{< asciinema key="demo" >}}
There should be a asciinema cast above! There should be a asciinema cast above!
{{< details title="Click to see sample json" >}}
```json
{
"external_tracker_url": "https://github.com/caddyserver/caddy/issues",
"external_tracker_format": "https://github.com/caddyserver/caddy/issues/{index}",
"external_tracker_style": "numeric",
"external_tracker_regexp_pattern": ""
}
```
{{< /details >}}

View File

@ -0,0 +1,9 @@
{{- /*
Template comment syntax: https://hugo.d.balki.me/templates/introduction/#comments
collapsable section ref: https://stackoverflow.com/a/78475534
*/ -}}
<details>
<summary>{{ .Get "title" | default "Click to expand" | markdownify }}</summary>
<div>{{ .Inner | markdownify }}</div>
</details>