aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-07-07 04:24:59 -0400
committertdro <tdro@noreply.example.com>2022-07-07 04:24:59 -0400
commit9ae8b12c1bb8f8f8d6927150c74e2381cb55c97d (patch)
tree85b4f5d8cc5da10c7b8dbd8d534978952afe2152
parentd42fb91ac4b4ae75c0ba02126965e71c2d8a68eb (diff)
downloadcanory-9ae8b12c1bb8f8f8d6927150c74e2381cb55c97d.tar.gz
canory-9ae8b12c1bb8f8f8d6927150c74e2381cb55c97d.tar.bz2
canory-9ae8b12c1bb8f8f8d6927150c74e2381cb55c97d.zip
themes/default/layouts/shortcodes/spoiler: Format and use self closing syntax
-rw-r--r--content/canory/messages/highlighting.md2
-rw-r--r--content/canory/messages/self.md8
-rw-r--r--themes/default/layouts/shortcodes/spoiler.html6
3 files changed, 8 insertions, 8 deletions
diff --git a/content/canory/messages/highlighting.md b/content/canory/messages/highlighting.md
index f49b217..600d44e 100644
--- a/content/canory/messages/highlighting.md
+++ b/content/canory/messages/highlighting.md
@@ -8,4 +8,4 @@ author = "canory"
Sometimes I'll {{< mark "highlight stuff" />}} to draw attention to my fine
eloquence. If I don't think things through, I'll ~~hide the what I
wrote~~. Whoops, let's just {{< ins "correct the record." >}}
-{{< spoiler "Move along --- nothing to see here." >}}
+{{< spoiler "Move along --- nothing to see here." />}}
diff --git a/content/canory/messages/self.md b/content/canory/messages/self.md
index ac86e20..8ca828d 100644
--- a/content/canory/messages/self.md
+++ b/content/canory/messages/self.md
@@ -5,10 +5,10 @@ tags = [ "docs", "self" ]
author = "canory"
+++
-Check out this party trick; this thing can quote other messages. {{< spoiler >}}
-Technically... the
-instructions from the manufacturer was not to do this --- but rules are made to be
-broken... right?
+Check out this party trick; this thing can quote other messages.
+{{< spoiler >}}
+Technically... the instructions from the manufacturer was not to do this --- but
+rules are made to be broken... right?
{{< /spoiler >}}
{{< self "/canory/messages/self#canory-messages-self.md" >}}
diff --git a/themes/default/layouts/shortcodes/spoiler.html b/themes/default/layouts/shortcodes/spoiler.html
index 9267876..fd3c9d3 100644
--- a/themes/default/layouts/shortcodes/spoiler.html
+++ b/themes/default/layouts/shortcodes/spoiler.html
@@ -1,9 +1,9 @@
{{- $text := default "This is a spoiler." (.Get "text" | default (.Get 0)) -}}
{{- $title := default "Click to show/hide text." (.Get "title" | default (.Get 1)) -}}
-{{ if gt (len .Inner) 1 }}
- {{ $text = .Inner }}
-{{ end }}
+{{- if gt (len .Inner) 1 -}}
+ {{- $text = .Inner -}}
+{{- end -}}
<input hidden type="checkbox" id="spoiler-text-{{ md5 $text }}" />
<s title="{{ $title }}"><label for="spoiler-text-{{ md5 $text }}">{{ $text | markdownify }}</label></s>