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

33 lines
907 B
HTML
Raw Normal View History

{{- $_hugo_config := `{ "version": 1 }` }}
2023-06-05 21:18:12 +00:00
{{- $color := (.Get "color") }}
{{- $content := .Inner }}
2023-06-05 21:18:12 +00:00
{{- $icon := (.Get "icon") }}
{{- $name := (.Get "name") }}
{{- $style := (.Get "style") }}
{{- $title := (.Get "title") }}
{{- $tabs := slice }}
{{- if and .Parent (.Parent.Store.Get "tabs") }}
{{- $tabs = .Parent.Store.Get "tabs" }}
{{- end }}
2023-06-05 21:18:12 +00:00
{{- $tabs = $tabs | append (dict
"color" $color
"content" $content
"icon" $icon
"name" $name
"style" $style
"title" $title
) }}
{{- if .Parent }}
{{- $.Parent.Store.Set "tabs" $tabs }}
{{- else }}
{{- /* if no containing tabs shortcode is present, we display this tab as single */}}
{{- partial "shortcodes/tabs.html" (dict
"page" .Page
2023-06-05 21:18:12 +00:00
"color" ""
"content" $tabs
2023-06-05 21:18:12 +00:00
"groupid" ""
"icon" ""
"style" ""
"title" ""
) }}
{{- end }}