hugo-theme-relearn/layouts/shortcodes/tab.html
Sören Weber fe7eb1d432
theme: wildspace
in shortcodes and shortcode output
2021-09-12 09:44:34 +02:00

11 lines
390 B
HTML

{{ if .Parent }}
{{ $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 }}
{{ else }}
{{- errorf "[%s] %q: tab shortcode missing its parent" site.Language.Lang .Page.Path -}}
{{ end}}