diff --git a/layouts/shortcodes/tab.html b/layouts/shortcodes/tab.html index 3a9db6c171..561659649e 100644 --- a/layouts/shortcodes/tab.html +++ b/layouts/shortcodes/tab.html @@ -19,34 +19,34 @@ {{/* store all tab info in dict tab */ -}} {{ $tab := dict "header" $header -}} {{ with $.Get "lang" -}} - {{ $tab = merge $tab (dict "language" ($.Get "lang")) -}} + {{ $tab = merge $tab (dict "language" .) -}} {{ end -}} {{ with $.Get "highlight" -}} - {{ $tab = merge $tab (dict "highlight" ($.Get "highlight")) -}} + {{ $tab = merge $tab (dict "highlight" .) -}} {{ end -}} {{ with $.Get "text" -}} {{ if ne ( printf "%T" . ) "bool" -}} {{ errorf "Shortcode %q: boolean value expected for parameter %q, but got %s. Error position: %s" $.Name "text" (printf "%T" .) $.Position -}} {{ end -}} - {{ $tab = merge $tab (dict "text" ($.Get "text")) -}} + {{ $tab = merge $tab (dict "text" .) -}} {{ end -}} {{ with $.Get "right" -}} {{ if ne ( printf "%T" . ) "bool" -}} {{ errorf "Shortcode %q: boolean value expected for parameter %q, but got %s. Error position: %s" $.Name "right" (printf "%T" .) $.Position -}} {{ end -}} - {{ $tab = merge $tab (dict "rightpush" ($.Get "right")) -}} + {{ $tab = merge $tab (dict "rightpush" .) -}} {{ end -}} {{ with $.Get "disabled" -}} {{ if ne ( printf "%T" . ) "bool" -}} {{ errorf "Shortcode %q: boolean value expected for parameter %q, but got %s. Error position: %s" $.Name "disabled" (printf "%T" .) $.Position -}} {{ end -}} - {{ $tab = merge $tab (dict "disabled" ($.Get "disabled")) -}} + {{ $tab = merge $tab (dict "disabled" .) -}} {{ end -}} {{ with $.Inner -}} {{/* Trim any leading and trailing newlines from .Inner, this avoids spurious lines during syntax highlighting */ -}} - {{ $tab = merge $tab (dict "content" $.Inner) -}} + {{ $tab = merge $tab (dict "content" .) -}} {{ end -}} {{/* add dict tab to parent's scratchpad */ -}} diff --git a/layouts/shortcodes/tabpane.html b/layouts/shortcodes/tabpane.html index 7359da5b11..8b0156618d 100644 --- a/layouts/shortcodes/tabpane.html +++ b/layouts/shortcodes/tabpane.html @@ -43,8 +43,9 @@ {{ $textPane := default false ($.Get "text") -}} {{ $langEqualsHeader := default false ($.Get "langEqualsHeader") -}} {{ $deprecatedPersistLang := $_persistLang | default true -}} -{{ $persistKeyKind := $_persist | default (cond (eq $langPane "") "lang" "header") -}} -{{ $persistTab := and $deprecatedPersistLang (ne $persistKeyKind "disabled") -}} +{{ $persistKeyKind := $_persist + | default (cond (or $textPane (ne "" $langPane)) "header" "lang") -}} +{{ $persistTabpane := and $deprecatedPersistLang (ne $persistKeyKind "disabled") -}} {{ $rightPane := default false ($.Get "right") -}} {{ $activeSet := false -}} {{/* Scratchpad gets populated through call to .Inner */ -}} @@ -59,10 +60,7 @@ {{ if $duplicate -}} @@ -138,10 +143,7 @@ {{ $lang = . -}} {{ end -}} - {{ $disabled := false -}} - {{ with $element.disabled -}} - {{ $disabled = . -}} - {{ end -}} + {{ $enabled := not $element.disabled -}} {{ $hloptions := $hloptionsPane -}} {{ with $element.highlight -}} @@ -155,7 +157,12 @@ {{ $tabid := printf "tabs-%02v-%v-tab" $tabPaneOrdinal $index | anchorize -}} {{ $entryid := printf "tabs-%02v-%v" $tabPaneOrdinal $index | anchorize }} -
{{ if $text -}} {{ index . "content" -}} @@ -164,9 +171,5 @@ {{ end }}
- {{- if not $disabled -}} - {{ $activeSet = true -}} - {{ end -}} - - {{ end }} + {{- end }}