add shortcode for collapsable section
This commit is contained in:
parent
d2a3d53e54
commit
f3c98b3e46
@ -10,3 +10,13 @@ asciinema: true
|
||||
{{< asciinema key="demo" >}}
|
||||
|
||||
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 >}}
|
||||
|
9
layouts/shortcodes/details.html
Normal file
9
layouts/shortcodes/details.html
Normal 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>
|
Loading…
Reference in New Issue
Block a user