2022-06-22 18:32:18 +00:00
|
|
|
{{- $content := .Inner }}
|
|
|
|
{{- $name := (.Get "name") }}
|
2023-05-23 21:57:48 +00:00
|
|
|
{{- $tabs := slice }}
|
|
|
|
{{- if and .Parent (.Parent.Scratch.Get "tabs") }}
|
|
|
|
{{- $tabs = .Parent.Scratch.Get "tabs" }}
|
|
|
|
{{- end }}
|
|
|
|
{{- $tabs = $tabs | append (dict "name" (trim $name " ") "content" $content) }}
|
2022-06-22 18:32:18 +00:00
|
|
|
{{- if .Parent }}
|
2023-05-23 21:57:48 +00:00
|
|
|
{{- $.Parent.Scratch.Set "tabs" $tabs }}
|
2022-06-22 18:32:18 +00:00
|
|
|
{{- else }}
|
2023-05-23 21:57:48 +00:00
|
|
|
{{- $c:=""}}{{/* if no containing tabs shortcode is present, we display this tab as single */}}
|
|
|
|
{{- partial "shortcodes/tabs.html" (dict
|
|
|
|
"context" .Page
|
|
|
|
"groupid" ""
|
|
|
|
"content" $tabs
|
|
|
|
) }}
|
|
|
|
{{- end }}
|