From 370f40ef5a9337dc0cc092e9466819c35396c112 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 23 Jan 2021 16:08:01 +0100 Subject: [PATCH] layouts: add spoiler shortcode --- content/posts/hello-world.md | 8 ++++++++ layouts/shortcodes/spoiler.html | 5 +++++ 2 files changed, 13 insertions(+) create mode 100644 layouts/shortcodes/spoiler.html diff --git a/content/posts/hello-world.md b/content/posts/hello-world.md index 3af908b..805eb07 100644 --- a/content/posts/hello-world.md +++ b/content/posts/hello-world.md @@ -39,3 +39,11 @@ echo hello world | cut -d' ' -f 1 \draw (0,0) circle (1in); \end{tikzpicture} {{% /tikz %}} + +### Spoilers + +{{% spoiler "Don't open me" %}} +Test 2 + +Test 3 +{{% /spoiler %}} diff --git a/layouts/shortcodes/spoiler.html b/layouts/shortcodes/spoiler.html new file mode 100644 index 0000000..1a959ee --- /dev/null +++ b/layouts/shortcodes/spoiler.html @@ -0,0 +1,5 @@ +{{- $title := .Get "title" | default (.Get 0) -}} +
+ {{ $title }} +

{{.Inner}}

+