aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/shortcodes/disclose.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/shortcodes/disclose.html')
-rw-r--r--themes/default/layouts/shortcodes/disclose.html6
1 files changed, 6 insertions, 0 deletions
diff --git a/themes/default/layouts/shortcodes/disclose.html b/themes/default/layouts/shortcodes/disclose.html
new file mode 100644
index 0000000..fdbcc6a
--- /dev/null
+++ b/themes/default/layouts/shortcodes/disclose.html
@@ -0,0 +1,6 @@
+{{- $text := default "Content Warning: " (.Get "text" | default (.Get 0)) -}}
+
+<details data-disclosure>
+ <summary>{{ (or $.Page.Params.title $text) | markdownify }}</summary>
+</details>
+{{- /* This comment removes trailing newlines and white spaces. */ -}}