mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2023-12-21 10:22:58 +01:00
Added shortcode for collapsing texts.
This commit is contained in:
parent
02c6c685b5
commit
59f648989a
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 New Issue
Block a user