mirror of https://github.com/luizdepra/hugo-coder.git

shaked8634
25.20.2024 d86f70a1791b47c6ffa76355e4e1d88d20e61d3f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{{ $group := .Page.Scratch.Get "tabGroupIndex" | default 0 }}
{{ $index := .Page.Scratch.Get "tabElementIndex" | default 0 }}
{{ $name := .Get "name" | default "Name Me!" }}
 
<style>
  .tabs input#tab-{{ $group }}-{{ $index }}:checked ~ .tab-content-{{ $group }}-{{ $index }} {
    display: block;
  }
</style>
 
<input type="radio" class="tab-input" name="tab-select-{{ $group }}" id="tab-{{ $group }}-{{ $index }}" {{ if eq $index 0 }}checked{{ end }}/>
<label for="tab-{{ $group }}-{{ $index }}" class="tab-label">{{ $name }}</label>
<div class="tab-content tab-content-{{ $group }}-{{ $index }}">
  {{ .Inner | markdownify }}
</div>
 
{{ .Page.Scratch.Set "tabElementIndex" (add 1 $index) }}