aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorAlex Shpak <alex-shpak@users.noreply.github.com>2020-04-21 22:30:00 +0200
committerAlex Shpak <alex-shpak@users.noreply.github.com>2020-04-21 22:30:00 +0200
commit66968582ef45a1c3c38f47477096e9417a774ce9 (patch)
tree4b675790dc85500027d557c2fa24581c26eda744 /layouts
parentb88d5f6b12fa9ac179ed8f54c00acbd747a6546f (diff)
#205, Add details shortcode
Diffstat (limited to 'layouts')
-rw-r--r--layouts/shortcodes/details.html6
-rw-r--r--layouts/shortcodes/expand.html1
2 files changed, 7 insertions, 0 deletions
diff --git a/layouts/shortcodes/details.html b/layouts/shortcodes/details.html
new file mode 100644
index 0000000..f6fff38
--- /dev/null
+++ b/layouts/shortcodes/details.html
@@ -0,0 +1,6 @@
+<details {{ if or (.Get "open") (in .Params "open") }}open{{ end }}>
+ <summary>{{ cond .IsNamedParams (.Get "title") (.Get 0) }}</summary>
+ <div class="markdown-inner">
+ {{ .Inner | markdownify }}
+ </div>
+</details>
diff --git a/layouts/shortcodes/expand.html b/layouts/shortcodes/expand.html
index 1c0cb6b..f254944 100644
--- a/layouts/shortcodes/expand.html
+++ b/layouts/shortcodes/expand.html
@@ -1,3 +1,4 @@
+{{ warnf "Expand shortcode is deprecated. Use 'details' instead." }}
<div class="book-expand">
<label>
<div class="book-expand-head flex justify-between">