mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 07:18:57 +00:00
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
This commit is contained in:
@@ -40,14 +40,16 @@
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Tabs Container */ -}}
|
||||
<tab-container default-tab="{{ $defaultTab }}" placement="{{ $placement }}"{{ with $type }} type="{{ . }}"{{ end }}>
|
||||
{{- range $index, $tab := $tabs -}}
|
||||
{{- $title := $tab.title | default (printf "Untitled%v" $index) -}}
|
||||
{{- $id := $tab.id -}}
|
||||
<button class="tab-button" type="button" role="tab" id="tab-{{ $id }}" aria-selected="{{ eq $index $defaultTab }}">{{ $title | $.Page.RenderString }}</button>
|
||||
{{- end -}}
|
||||
{{- .Inner -}}
|
||||
</tab-container>
|
||||
<div class="shortcode-tabs">
|
||||
<tab-container default-tab="{{ $defaultTab }}" placement="{{ $placement }}"{{ with $type }} type="{{ . }}"{{ end }}>
|
||||
{{- range $index, $tab := $tabs -}}
|
||||
{{- $title := $tab.title | default (printf "Untitled%v" $index) -}}
|
||||
{{- $id := $tab.id -}}
|
||||
<button class="tab-button" type="button" role="tab" id="tab-{{ $id }}" aria-selected="{{ eq $index $defaultTab }}">{{ $title | $.Page.RenderString }}</button>
|
||||
{{- end -}}
|
||||
{{- .Inner | strings.TrimSpace | .Page.RenderString -}}
|
||||
</tab-container>
|
||||
</div>
|
||||
|
||||
{{- .Page.Store.Set "hasTabs" true -}}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user