aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-11-18 19:41:45 -0500
committertdro <tdro@noreply.example.com>2022-11-18 19:41:45 -0500
commit886e656644c9895f7c5350411898ae35f495d9a2 (patch)
treec445b08e4a3d7a79ed11b3608252a31ec1ccb546
parentf38088bf3bcf8f4d1b5c7e42f2abc2b9b89d2eb4 (diff)
downloadcanory-886e656644c9895f7c5350411898ae35f495d9a2.tar.gz
canory-886e656644c9895f7c5350411898ae35f495d9a2.tar.bz2
canory-886e656644c9895f7c5350411898ae35f495d9a2.zip
themes/default/layouts/shortcodes/disclose: Allow inner
Inherit display instead of revert
-rw-r--r--assets/css/default.css2
-rw-r--r--content/canory/messages/unsafe.md2
-rw-r--r--themes/default/layouts/shortcodes/disclose.html4
3 files changed, 6 insertions, 2 deletions
diff --git a/assets/css/default.css b/assets/css/default.css
index 2f43e4c..511ef7e 100644
--- a/assets/css/default.css
+++ b/assets/css/default.css
@@ -1173,7 +1173,7 @@ micro-content details[data-disclosure] ~ * {
}
micro-content details[data-disclosure][open] ~ * {
- display: revert;
+ display: inherit;
}
tab-bar {
diff --git a/content/canory/messages/unsafe.md b/content/canory/messages/unsafe.md
index a7e1c4c..eeea4cf 100644
--- a/content/canory/messages/unsafe.md
+++ b/content/canory/messages/unsafe.md
@@ -5,7 +5,7 @@ tags = [ "docs", "unsafe" ]
author = "canory"
+++
-{{< disclose >}}
+{{< disclose />}}
Is it safe? Well this message ain't.
{{< quote
diff --git a/themes/default/layouts/shortcodes/disclose.html b/themes/default/layouts/shortcodes/disclose.html
index fdbcc6a..2cc99c7 100644
--- a/themes/default/layouts/shortcodes/disclose.html
+++ b/themes/default/layouts/shortcodes/disclose.html
@@ -1,5 +1,9 @@
{{- $text := default "Content Warning: " (.Get "text" | default (.Get 0)) -}}
+{{- if gt (len .Inner) 1 -}}
+ {{- $text = .Inner -}}
+{{- end -}}
+
<details data-disclosure>
<summary>{{ (or $.Page.Params.title $text) | markdownify }}</summary>
</details>