From 280a9fa9f1f26b421ec9f43f3bf8caa57ef8967d Mon Sep 17 00:00:00 2001 From: Aaron Crawfis Date: Wed, 14 Oct 2020 12:44:48 -0700 Subject: [PATCH] Add shortcodes for tabs --- daprdocs/layouts/shortcodes/codetab.html | 21 ++++++++++++++++++ daprdocs/layouts/shortcodes/tabs.html | 27 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 daprdocs/layouts/shortcodes/codetab.html create mode 100644 daprdocs/layouts/shortcodes/tabs.html diff --git a/daprdocs/layouts/shortcodes/codetab.html b/daprdocs/layouts/shortcodes/codetab.html new file mode 100644 index 000000000..8b72c96d4 --- /dev/null +++ b/daprdocs/layouts/shortcodes/codetab.html @@ -0,0 +1,21 @@ +{{- $index := .Ordinal -}} + +{{- if ne .Parent.Name "tabs" -}} +{{- errorf "codetab must be used within a tabs block" -}} +{{- end -}} + + +{{- $guid := printf "tabs-%d" .Parent.Ordinal -}} + + +{{- $entry := .Parent.Get $index -}} +{{- $entry := lower $entry -}} + +{{- $tabid := printf "%s-%s-tab" $guid $entry | anchorize -}} +{{- $entryid := printf "%s-%s" $guid $entry | anchorize -}} + +
+
+ {{- .Inner -}} +
\ No newline at end of file diff --git a/daprdocs/layouts/shortcodes/tabs.html b/daprdocs/layouts/shortcodes/tabs.html new file mode 100644 index 000000000..dbf753387 --- /dev/null +++ b/daprdocs/layouts/shortcodes/tabs.html @@ -0,0 +1,27 @@ + +{{- $guid := printf "tabs-%d" .Ordinal -}} + +{{- .Scratch.Set "first" true -}} + + + + +
+{{ .Inner }} +
\ No newline at end of file