aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/shortcodes
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-11-18 17:33:34 -0500
committertdro <tdro@noreply.example.com>2022-11-18 17:33:34 -0500
commitd7df1c7a2850c0cff38f309882564782b49186f1 (patch)
tree45bfd493bfeadbda7d1e044b605bc18b0284c4ed /themes/default/layouts/shortcodes
parentd3e45e2a19fd66f6c807368ee9abc59b975fe4fb (diff)
downloadcanory-d7df1c7a2850c0cff38f309882564782b49186f1.tar.gz
canory-d7df1c7a2850c0cff38f309882564782b49186f1.tar.bz2
canory-d7df1c7a2850c0cff38f309882564782b49186f1.zip
themes/default/layouts/shortcodes: Generalize content warnings with disclose short code
Diffstat (limited to 'themes/default/layouts/shortcodes')
-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. */ -}}