hugo-theme-relearn/layouts/shortcodes/tab.html
Sören Weber ab4197f311
Some checks are pending
docs-build-deployment / Run deploy (push) Waiting to run
docs-build / Run build (push) Waiting to run
theme: remove .Scratch with .Store #948
2024-11-18 19:13:41 +01:00

33 lines
No EOL
907 B
HTML

{{- $_hugo_config := `{ "version": 1 }` }}
{{- $color := (.Get "color") }}
{{- $content := .Inner }}
{{- $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 }}
{{- $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
"color" ""
"content" $tabs
"groupid" ""
"icon" ""
"style" ""
"title" ""
) }}
{{- end }}