hugo-geekdoc/layouts/shortcodes/tabs.html

23 lines
604 B
HTML
Raw Normal View History

2020-01-12 14:33:02 +00:00
{{ if .Inner }}{{ end }}
{{ $id := .Get 0 }}
{{ $group := printf "tabs-%s" $id }}
2020-01-12 14:33:02 +00:00
<div class="gdoc-tabs">
2023-02-03 22:02:16 +00:00
{{ range $index, $tab := .Scratch.Get $group }}
<input
type="radio"
class="gdoc-tabs__control hidden"
name="{{ $group }}"
id="{{ printf "%s-%d" $group $index }}"
{{ if not $index }}checked="checked"{{ end }}
/>
<label for="{{ printf "%s-%d" $group $index }}" class="gdoc-tabs__label">
{{ $tab.Name }}
</label>
<div class="gdoc-markdown--nested gdoc-tabs__content">
{{ .Content | $.Page.RenderString }}
</div>
{{ end }}
2020-01-12 14:33:02 +00:00
</div>