From 9ae8b12c1bb8f8f8d6927150c74e2381cb55c97d Mon Sep 17 00:00:00 2001 From: tdro Date: Thu, 7 Jul 2022 04:24:59 -0400 Subject: themes/default/layouts/shortcodes/spoiler: Format and use self closing syntax --- content/canory/messages/highlighting.md | 2 +- content/canory/messages/self.md | 8 ++++---- themes/default/layouts/shortcodes/spoiler.html | 6 +++--- 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 -}} -- cgit v1.2.3