Docs: add details shortcode (#279)

Signed-off-by: Carson Yang <yangchuansheng33@gmail.com>
This commit is contained in:
Carson Yang
2023-09-11 20:48:14 +08:00
committed by GitHub
parent b0e7d25464
commit b2b3aa651d
6 changed files with 39 additions and 8 deletions

View File

@@ -0,0 +1,11 @@
{{- $title := .Get "title" | default "" -}}
{{- $closed := eq (.Get "closed") "true" | default false -}}
<details class="last-of-type:mb-0 rounded p-2 mt-4 mb-4 group alert-info" {{ if not $closed }}open{{ end }}>
<summary class="p-1 rounded">
<strong>{{ $title | markdownify }}</strong>
</summary>
<div class="mt-3">
{{ .InnerDeindent | markdownify }}
</div>
</details>