aboutsummaryrefslogtreecommitdiff
path: root/layouts/shortcodes/tabs.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/shortcodes/tabs.html')
-rw-r--r--layouts/shortcodes/tabs.html19
1 files changed, 19 insertions, 0 deletions
diff --git a/layouts/shortcodes/tabs.html b/layouts/shortcodes/tabs.html
new file mode 100644
index 0000000..65c1f02
--- /dev/null
+++ b/layouts/shortcodes/tabs.html
@@ -0,0 +1,19 @@
+{{ if .Inner }}{{ end }}
+{{ $id := .Get 0 }}
+{{ $group := printf "tabs-%s" $id }}
+
+<div class="book-tabs">
+ <div class="book-tabs-head">
+ {{ range $index, $tab := .Scratch.Get $group}}
+ <label for="{{ printf "%s-%d" $group $index }}">
+ <span>{{ $tab.Name }}</span>
+ </label>
+ {{ end }}
+ </div>
+ {{ range $index, $tab := .Scratch.Get $group}}
+ <input type="radio" name="{{ $group }}" style="display: none;" id="{{ printf "%s-%d" $group $index }}" {{ if not $index }}checked="checked"{{ end }} />
+ <div class="book-tabs-content markdown-inner">
+ <span>{{ .Content | markdownify }}</span>
+ </div>
+ {{ end }}
+</div>