mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
17 lines
No EOL
574 B
HTML
17 lines
No EOL
574 B
HTML
{{- $content := .Inner }}
|
|
{{- $name := (.Get "name") }}
|
|
{{- $tabs := slice }}
|
|
{{- if and .Parent (.Parent.Scratch.Get "tabs") }}
|
|
{{- $tabs = .Parent.Scratch.Get "tabs" }}
|
|
{{- end }}
|
|
{{- $tabs = $tabs | append (dict "name" (trim $name " ") "content" $content) }}
|
|
{{- if .Parent }}
|
|
{{- $.Parent.Scratch.Set "tabs" $tabs }}
|
|
{{- else }}
|
|
{{- $c:=""}}{{/* if no containing tabs shortcode is present, we display this tab as single */}}
|
|
{{- partial "shortcodes/tabs.html" (dict
|
|
"context" .Page
|
|
"groupid" ""
|
|
"content" $tabs
|
|
) }}
|
|
{{- end }} |