{{ range $i, $e := $tabs }}
{{ $id := printf "%s-%d" $tab_set_id $i }}
- {{ trim .name " " }}
{{ end }}
{{ range $i, $e := $tabs }}
{{ $id := printf "%s-%d" $tab_set_id $i }}
{{ with .content }}
{{ . }}
{{ else }}
{{ if eq $.Page.BundleType "leaf" }}
{{/* find the file somewhere inside the bundle. Note the use of double asterisk */}}
{{ with $.Page.Resources.GetMatch (printf "**%s*" .include) }}
{{ if ne .ResourceType "page" }}
{{/* Assume it is a file that needs code highlighting. */}}
{{ $codelang := $e.codelang | default ( path.Ext .Name | strings.TrimPrefix ".") }}
{{ highlight .Content $codelang "" }}
{{ else}}
{{ .Content }}
{{ end }}
{{ end }}
{{ else}}
{{ $path := path.Join $.Page.Dir .include }}
{{ $page := $.Page.Site.GetPage "page" $path }}
{{ with $page }}
{{ .Content }}
{{ else }}
{{ errorf "[%s] tabs include not found for path %q" $.Page.Site.Language.Lang $path}}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ $elem := $tab_set_id | safeJS }}