Files
FixIt/layouts/_shortcodes/tab.html
T
Cell 5b43c2b6a3 fix(tabs): improve tab shortcode rendering and restore sticky code header (#772)
* fix(tabs): improve tab shortcode rendering and trim whitespace

* fix(tabs): restore sticky code header for left/right placement
2026-05-28 12:56:07 +08:00

16 lines
747 B
HTML

{{- with $.Parent -}}
{{- if ne $.Parent.Name "tabs" -}}
{{- errorf "Found shortcode %q enclosed inside a %q block, must be enclosed inside a %q block. Error position: %s" $.Name $.Parent.Name "tabs" $.Position -}}
{{- end -}}
{{- else -}}
{{- errorf "The shortcode %q must be enclosed inside a %q block, but no parent block was found. Error position: %s" $.Name "tabs" $.Position -}}
{{- end -}}
{{- $id := dict "Page" .Page | partial "function/id.html" -}}
{{- $title := .Get "title" -}}
{{- .Parent.Store.Add "tabs" (slice (dict "title" $title "id" $id)) -}}
{{- /* Tab panel */ -}}
<div role="tabpanel" aria-labelledby="tab-{{ $id }}" class="tab-panel">{{ .Inner | strings.TrimSpace | .Page.RenderString }}</div>
{{- /* EOF */ -}}