Files
blowfish/layouts/shortcodes/tab.html
2025-12-01 21:14:15 +08:00

8 lines
370 B
HTML

{{- $label := .Get "label" -}}
{{- $index := .Parent.Store.Get "tab-index" | default 0 -}}
{{- $content := .InnerDeindent | strings.TrimSpace | .Page.RenderString -}}
{{- $tabs := .Parent.Store.Get "tabs" | default slice -}}
{{- .Parent.Store.Set "tabs" ($tabs | append (dict "label" $label "content" $content)) -}}
{{- .Parent.Store.Set "tab-index" (add 1 $index) -}}