layouts/partials/tabs/wrapper.html
{{ $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 -}}
Language: {{ range $i, $tab := $tabs }} {{ $dataLang := replace (or (index $tab "language") "redis-cli") "C#" "dotnet" }} {{ $dataLang := replace $dataLang "." "-" }} {{ $displayName := "" }} {{ if eq (index $tab "title") "redis-cli" }} {{ $displayName = or (index $tab "displayName") $cliName }} {{ else }} {{ $displayName = or (index $tab "displayName") (index $tab "title") }} {{ end }} {{ $displayName }} {{ end }}
{{/* BinderHub "Run in browser" link - shown conditionally based on current tab's binderId */}} {{/* Link will be shown/hidden by JavaScript based on selected tab */}} Copied! Copied!
{{- 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 }} {{/* Commands foldout section */}} {{ if $commands }} {{ $tabTitle := index $tab "title" }} {{ partial "commands-foldout.html" (dict "commands" $commands "id" $id "tabTitle" $tabTitle) }} {{ end }} {{ if eq (index $tab "title") "redis-cli" }} {{ $displayName := index $tab "displayName" }} {{ $hasCustomTabName := and $displayName (ne $displayName $cliName) }} {{ $customLinkText := index $tab "customFooterLinkText" }} {{ $customLinkUrl := index $tab "customFooterLinkUrl" }} {{ if and $customLinkText $customLinkUrl }} {{ $customLinkText }}
{{ else }} {{ if $hasCustomTabName }}
{{ else }} Redis CLI guide Also, check out our other client tools Redis Insight and Redis for VS Code. {{ end }} {{ end }} {{ else }} {{ index $tab "title" }} {{ $btnQuickStartText }}
{{ $sourceUrl := index $tab "sourceUrl" }} {{ if $sourceUrl }} {{ end }} {{ end }}
{{ end }} {{ end }}