{{- /* Create a tabbed interface with the given items. @param {string} items The items to display in the tabs. @param {string} defaultIndex The index of the default tab. @example {{< tabs items="JSON,YAML,TOML" >}}{{< /tabs >}} */ -}} {{- $items := split (.Get "items") "," -}} {{- $defaultIndex := int ((.Get "defaultIndex") | default "0") -}} {{- $enableSync := site.Params.page.tabs.sync | default false -}} {{- if not (.Get "items") -}} {{ errorf "tabs shortcode: 'items' parameter is required" }} {{- end -}} {{- if not $items -}} {{ errorf "tabs shortcode: 'items' parameter cannot be empty" }} {{- end -}} {{- range $items -}} {{- if eq (trim . " ") "" -}} {{ errorf "tabs shortcode: empty item found in 'items' parameter" }} {{- end -}} {{- end -}}
{{- range $i, $item := $items -}} {{- end -}}
{{- .Inner -}}
{{- /* Drop trailing newlines */ -}}