1
0
Fork 0

Merge pull request #66 from jtagcat/collapse

Added shortcode for collapsing texts.
This commit is contained in:
南小北 2020-08-18 23:49:01 +08:00 committed by GitHub
commit 5b7336e1f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,12 @@
{{ if .Get "content" }}
{{ if .Get "summary" }}
{{ else }}
{{ warnf "missing value for param 'summary': %s" .Position }}
{{ end }}
{{ else }}
{{ errorf "missing value for param 'content': %s" .Position }}
{{ end }}
<p><details {{ if (eq (.Get "openByDefault") true) }} open=true {{ end }}>
<summary markdown="span">{{ .Get "summary" | markdownify }}</summary>
{{ .Get "content" | markdownify }}
</details></p>