culinary.kemonine.info/themes/hugo-theme-relearn/layouts/shortcodes/tab.html

10 lines
388 B
HTML
Raw Normal View History

2022-12-03 15:27:03 +00:00
{{- $content := .Inner }}
{{- $name := (.Get "name") }}
{{- if .Parent }}
{{- if not (.Parent.Scratch.Get "tabs") }}
{{- .Parent.Scratch.Set "tabs" slice }}
{{- end }}
{{- $.Parent.Scratch.Add "tabs" (dict "name" (trim $name " ") "content" $content ) }}
{{- else }}
{{- errorf "[%s] %q: tab shortcode missing its parent" site.Language.Lang .Page.Path -}}
{{- end}}