{{ $id := (or (.id) (substr (.Inner | md5) 0 4)) }} {{ $tabs := (or (.tabs) (slice (dict "title" "error" "content" "Example not found"))) }} {{ $cliName := ">_ Redis CLI" }} {{ $btnQuickStartText := "Quick-Start" }} {{ $btnRIText := "Get Redis Insight" }} {{ $btnRIUrl := "https://redis.com/redis-enterprise/redis-insight/" }} {{ $showFooter := (.showFooter) }} {{ $exampleId := .exampleId }} {{ $description := .description }} {{ $difficulty := .difficulty }} {{ $buildsUpon := .buildsUpon }} {{- /* Build metadata map for each language/client combination */ -}} {{- $codetabsMeta := dict -}} {{- range $tab := $tabs -}} {{- $tabTitle := index $tab "title" -}} {{- $clientConfig := index $.Site.Params.clientsConfig $tabTitle -}} {{- $tabMeta := dict -}} {{- /* For redis-cli, use special handling */ -}} {{- if eq $tabTitle "redis-cli" -}} {{- $tabMeta = dict "language" "redis-cli" "client" "redis-cli" -}} {{- else if $clientConfig -}} {{- /* Extract language and client from config */ -}} {{- $langId := index $clientConfig "langId" -}} {{- $clientId := index $clientConfig "clientId" -}} {{- $tabMeta = dict "language" $langId "client" $clientId -}} {{- /* Add mode if it's a Java variant */ -}} {{- if or (eq $tabTitle "Java-Sync") (eq $tabTitle "Java-Async") (eq $tabTitle "Java-Reactive") -}} {{- $mode := "" -}} {{- if eq $tabTitle "Java-Sync" -}} {{- $mode = "sync" -}} {{- else if eq $tabTitle "Java-Async" -}} {{- $mode = "async" -}} {{- else if eq $tabTitle "Java-Reactive" -}} {{- $mode = "reactive" -}} {{- end -}} {{- $tabMeta = merge $tabMeta (dict "mode" $mode) -}} {{- end -}} {{- /* Add mode if it's a C# variant */ -}} {{- if or (eq $tabTitle "C#-Sync") (eq $tabTitle "C#-Async") -}} {{- $mode := "" -}} {{- if eq $tabTitle "C#-Sync" -}} {{- $mode = "sync" -}} {{- else if eq $tabTitle "C#-Async" -}} {{- $mode = "async" -}} {{- end -}} {{- $tabMeta = merge $tabMeta (dict "mode" $mode) -}} {{- end -}} {{- /* Add mode if it's a Rust variant */ -}} {{- if or (eq $tabTitle "Rust-Sync") (eq $tabTitle "Rust-Async") -}} {{- $mode := "" -}} {{- if eq $tabTitle "Rust-Sync" -}} {{- $mode = "sync" -}} {{- else if eq $tabTitle "Rust-Async" -}} {{- $mode = "async" -}} {{- end -}} {{- $tabMeta = merge $tabMeta (dict "mode" $mode) -}} {{- end -}} {{- else -}} {{- /* Fallback for unknown clients */ -}} {{- $tabMeta = dict "language" $tabTitle "client" $tabTitle -}} {{- end -}} {{- $codetabsMeta = merge $codetabsMeta (dict $tabTitle $tabMeta) -}} {{- end -}} {{- $codetabsMetaJson := $codetabsMeta | jsonify -}} {{- if $exampleId -}} {{- end -}}
{{/* BinderHub "Run in browser" link - shown conditionally based on current tab's binderId */}}
{{- if $description -}}
{{ $description }}
{{- end -}}
{{ range $i, $tab := $tabs }} {{ $tid := printf "%s_%s" (replace (replace (index $tab "title") "#" "sharp") "." "") $id }} {{ $pid := printf "panel_%s" $tid }} {{ $dataLang := replace (or (index $tab "language") "redis-cli") "C#" "dotnet" }} {{ $dataLang := replace $dataLang "." "-" }} {{ $binderId := index $tab "binderId" }} {{ $commands := index $tab "commands" }}
{{ index $tab "content" }} {{ if $showFooter }} {{ end }}
{{ end }}