aboutsummaryrefslogtreecommitdiff
path: root/layouts/shortcodes/tabs.html
blob: 65c1f025a4a7e4cd908e5c641f2adc9835f7f691 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{{ if .Inner }}{{ end }}
{{ $id := .Get 0 }}
{{ $group := printf "tabs-%s" $id }}

<div class="book-tabs">
  <div class="book-tabs-head">
  {{ range $index, $tab :=  .Scratch.Get $group}}
    <label for="{{ printf "%s-%d" $group $index }}">
      <span>{{ $tab.Name }}</span>
    </label>
  {{ end }}
  </div>
  {{ range $index, $tab := .Scratch.Get $group}}
  <input type="radio" name="{{ $group }}" style="display: none;" id="{{ printf "%s-%d" $group $index }}" {{ if not $index }}checked="checked"{{ end }} />
  <div class="book-tabs-content markdown-inner">
    <span>{{ .Content | markdownify }}</span>
  </div>
  {{ end }}
</div>