layouts: add spoiler shortcode
This commit is contained in:
parent
d20b6aed18
commit
370f40ef5a
|
@ -39,3 +39,11 @@ echo hello world | cut -d' ' -f 1
|
||||||
\draw (0,0) circle (1in);
|
\draw (0,0) circle (1in);
|
||||||
\end{tikzpicture}
|
\end{tikzpicture}
|
||||||
{{% /tikz %}}
|
{{% /tikz %}}
|
||||||
|
|
||||||
|
### Spoilers
|
||||||
|
|
||||||
|
{{% spoiler "Don't open me" %}}
|
||||||
|
Test 2
|
||||||
|
|
||||||
|
Test 3
|
||||||
|
{{% /spoiler %}}
|
||||||
|
|
5
layouts/shortcodes/spoiler.html
Normal file
5
layouts/shortcodes/spoiler.html
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{{- $title := .Get "title" | default (.Get 0) -}}
|
||||||
|
<details>
|
||||||
|
<summary>{{ $title }}</summary>
|
||||||
|
<p>{{.Inner}}</p>
|
||||||
|
</details>
|
Loading…
Reference in a new issue