hugo-theme-relearn/layouts/shortcodes/tab.html

13 lines
391 B
HTML
Raw Normal View History

{{ if .Parent }}
2021-08-23 21:57:56 +00:00
{{ $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" . ) }}
2021-08-23 21:57:56 +00:00
{{ end }}
{{ else }}
2021-08-23 21:57:56 +00:00
{{- errorf "[%s] %q: tab shortcode missing its parent" site.Language.Lang .Page.Path -}}
{{ end}}