mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-24 00:03:10 +00:00
24 lines
750 B
HTML
24 lines
750 B
HTML
|
{{- $context := .context }}
|
||
|
{{- $tabs := .tabs | default slice }}
|
||
|
{{- $groupId := .groupId | default "default" }}
|
||
|
{{- with $context }}
|
||
|
<div class="tab-panel">
|
||
|
<div class="tab-nav">
|
||
|
{{- range $idx, $tab := $tabs }}
|
||
|
<button
|
||
|
data-tab-item="{{ .name }}"
|
||
|
data-tab-group="{{ $groupId }}"
|
||
|
class="tab-nav-button {{ cond (eq $idx 0) "active" ""}}"
|
||
|
onclick="switchTab('{{ $groupId }}','{{ .name }}')"
|
||
|
><span>{{ .name }}</span></button>
|
||
|
{{- end }}
|
||
|
</div>
|
||
|
<div class="tab-content">
|
||
|
{{- range $idx, $tab := $tabs }}
|
||
|
<div data-tab-item="{{ .name }}" data-tab-group="{{ $groupId }}" class="tab-item {{ cond (eq $idx 0) "active" ""}}">
|
||
|
{{ .content | safeHTML }}
|
||
|
</div>
|
||
|
{{- end }}
|
||
|
</div>
|
||
|
</div>
|
||
|
{{- end }}
|