Files
blowfish/layouts/shortcodes/tab.html
ZhenShuo Leo 20044af981 feat: add tabs
2025-12-01 20:24:26 +08:00

6 lines
284 B
HTML

{{- $index := .Parent.Scratch.Get "tab-index" | default 0 -}}
{{- .Parent.Scratch.Set "tab-index" (add 1 $index) -}}
<div class="tab__panel {{ if eq $index 0 }}tab--active{{ end }}" data-tab-index="{{ $index }}">
{{ .InnerDeindent | strings.TrimSpace | .Page.RenderString }}
</div>