Skip to content

Commit 981d4cd

Browse files
Add details shortcode (#370)
1 parent 7c36891 commit 981d4cd

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

layouts/shortcodes/details.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{/*
2+
3+
doc: Hide the details.
4+
5+
{{< details "**Sunday**" >}}
6+
| Time | Description |
7+
|------|-------------|
8+
| | Arrive |
9+
| | Dinner (self organized) |
10+
{{< /details >}}
11+
12+
*/}}
13+
14+
{{ $summary:= .Get 0 | markdownify }}
15+
{{ $content := .Inner | markdownify }}
16+
<p>
17+
<details>
18+
<summary>{{$summary}}</summary>
19+
<p>{{$content}}</p>
20+
</details>
21+
</p>

0 commit comments

Comments
 (0)