istio.io/layouts/shortcodes/tab.html

13 lines
445 B
HTML

{{- if .Parent -}}
{{- $name := trim (.Get "name") " " -}}
{{- $cookie_value := trim (.Get "cookie-value") " " -}}
{{- if not (.Parent.Scratch.Get "tabs") -}}
{{- .Parent.Scratch.Set "tabs" slice -}}
{{- end -}}
{{- with .Inner -}}
{{- $.Parent.Scratch.Add "tabs" (dict "name" $name "cookie_value" $cookie_value "content" . ) -}}
{{- end -}}
{{- else -}}
{{- errorf "Missing surrounding tabset for tab (%s)" .Position -}}
{{- end -}}