mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-30 11:13:06 +00:00
27 lines
No EOL
742 B
HTML
27 lines
No EOL
742 B
HTML
{{- $context := .context }}
|
|
{{- $tabs := .tabs | default slice }}
|
|
{{- $groupid := .groupid | default "default" }}
|
|
{{- with $context }}
|
|
<div class="tab-panel" data-tab-group="{{ $groupid }}">
|
|
<div class="tab-nav">
|
|
{{- range $idx, $tab := $tabs }}
|
|
<button
|
|
data-tab-item="{{ .name }}"
|
|
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 }}"
|
|
class="tab-content-text{{ cond (eq $idx 0) " active" ""}}"
|
|
>
|
|
{{ .content | safeHTML }}
|
|
</div>
|
|
{{- end }}
|
|
</div>
|
|
</div>
|
|
{{- end }} |