lyceum-site/themes/hugo-book/layouts/shortcodes/tabs.html

15 lines
492 B
HTML
Raw Normal View History

2024-10-03 22:08:11 +00:00
{{ if .Inner }}{{ end }}
{{ $group := printf "tabs-%d" .Ordinal }}
<div class="book-tabs">
{{- range $index, $tab := .Scratch.Get $group -}}
<input type="radio" class="toggle" name="{{ $group }}" id="{{ printf "%s-%d" $group $index }}" {{ if not $index }}checked="checked"{{ end }} />
<label for="{{ printf "%s-%d" $group $index }}">
{{- $tab.Name -}}
</label>
<div class="book-tabs-content markdown-inner">
{{- .Content | $.Page.RenderString -}}
</div>
{{- end -}}
</div>