Files
docker-docs/layouts/shortcodes/tab.html
David Karlsson a0d21ade2f migrate to hugo
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2023-08-22 09:41:02 +02:00

13 lines
345 B
HTML

{{ if ne .Parent.Name "tabs" }}
{{- errorf "tab shortcode missing its 'tabs' parent: %s" .Position -}}
{{ end }}
{{ $name := trim (.Get "name") " " }}
{{ if not (.Parent.Scratch.Get "tabs") }}
{{ .Parent.Scratch.Set "tabs" slice }}
{{ end }}
{{ with .Inner }}
{{ $.Parent.Scratch.Add "tabs" (dict "name" $name "content" . ) }}
{{ end }}