This repository has been archived on 2026-05-22. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blowfish/layouts/shortcodes/tab.html
T
Alex Haslam 19a4e5f5af Add md flag
2026-02-16 09:27:51 +00:00

14 lines
571 B
HTML

{{- $label := .Get "label" -}}
{{- $icon := .Get "icon" -}}
{{- $index := .Parent.Store.Get "tab-index" | default 0 -}}
{{- $md := .Get "md" | default true -}}
{{- $isMarkdown := or (eq $md true) (eq $md "true") -}}
{{- $content := .Inner -}}
{{- if $isMarkdown -}}
{{- $content = .InnerDeindent | strings.TrimSpace | .Page.RenderString -}}
{{- end -}}
{{- $tabs := .Parent.Store.Get "tabs" | default slice -}}
{{- .Parent.Store.Set "tabs" ($tabs | append (dict "label" $label "icon" $icon "content" $content)) -}}
{{- .Parent.Store.Set "tab-index" (add 1 $index) -}}