Merge pull request #66 from jtagcat/collapse
Added shortcode for collapsing texts.
This commit is contained in:
commit
5b7336e1f1
1 changed files with 12 additions and 0 deletions
12
layouts/shortcodes/collapse.html
Normal file
12
layouts/shortcodes/collapse.html
Normal 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>
|
Loading…
Reference in a new issue