2022-06-22 18:32:18 +00:00
{{- $context := .context }}
2023-05-23 21:57:48 +00:00
{{- $tabs := .content | default slice }}
2023-05-23 21:53:52 +00:00
{{- $groupid := .groupid | default (partial "make-random-md5.hugo" $context) }}
2022-06-22 18:32:18 +00:00
{{- with $context }}
2023-06-05 16:31:55 +00:00
< div class = "tab-panel" data-tab-group = "{{ $groupid }}" >
2022-06-22 18:32:18 +00:00
< div class = "tab-nav" >
{{- range $idx, $tab := $tabs }}
< button
2023-06-03 11:14:15 +00:00
data-tab-item="{{ .name | $context.RenderString | plainify }}"
2023-06-05 16:31:55 +00:00
class="tab-nav-button tab-panel-style cstyle default{{ cond (eq $idx 0) " active" ""}}"
2023-06-03 11:14:15 +00:00
onclick="switchTab('{{ $groupid }}','{{ .name | $context.RenderString | plainify}}')"
2023-01-29 15:45:42 +00:00
>
2023-06-04 22:27:51 +00:00
< div > < div > {{ .name | $context.RenderString }}< / div > < / div >
< / button >
2022-06-22 18:32:18 +00:00
{{- end }}
< / div >
2023-06-05 16:31:55 +00:00
< div class = "tab-content-container" >
{{- range $idx, $tab := $tabs }}
2023-01-29 15:45:42 +00:00
< div
2023-06-03 11:14:15 +00:00
data-tab-item="{{ .name | $context.RenderString | plainify }}"
2023-06-05 16:31:55 +00:00
class="tab-content tab-panel-style cstyle default{{ cond (eq $idx 0) " active" ""}}">
< div class = "tab-content-text" >
2023-06-04 22:24:14 +00:00
{{ if ne "< " (substr (strings.TrimLeft " " .content) 0 1) }}< p > {{ end }}<!-- we add a DOM element here if there is none to make collapsing marings work -->
2023-05-23 21:57:48 +00:00
{{ .content | safeHTML }}< / div > <!-- no line break allowed here because of awkward behavior of Hugo 110 or this theme when tag shortcode is called standalone outside of tags shortcode ? -->
2023-06-05 16:31:55 +00:00
< / div >
{{- end }}
2022-06-22 18:32:18 +00:00
< / div >
< / div >
{{- end }}