1
0
Fork 0
ejv2.cc/themes/dead-simple/layouts/shortcodes/tabs.html
2024-08-01 06:21:40 +01:00

18 lines
589 B
HTML

{{ if .Inner }}{{ end }}
{{ $id := .Scratch.Get "tabs-id" }}
{{ $group := printf "tabs-%d" $id }}
<div class="md-tabs">
{{- range $index, $tab := .Scratch.Get $group -}}
{{ $individualTabId := printf "%s-%d" $group $index }}
<input type="radio" class="hidden" name="{{ $group }}" id="{{ $individualTabId }}" {{ if not $index }}checked="checked"{{ end }} />
<label for="{{ $individualTabId }}">
{{- $tab.Name -}}
</label>
<div class="md-tabs-content markdown-inner">
{{- .Content | markdownify | safeHTML -}}
</div>
{{- end -}}
</div>
{{ .Scratch.Delete "tabs-id" }}