Skip to content

Commit 52063a7

Browse files
DOC-5503 New param to override default tab name
1 parent 89c6f2f commit 52063a7

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

layouts/partials/tabbed-clients-example.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{{ $lang := .Scratch.Get "lang" }}
44
{{ $redisCommands := .Scratch.Get "redisCommands" }}
55
{{ $redisCommandsLineLimit := (or (.Scratch.Get "maxLines") 100) }}
6+
{{ $cliTabName := (or (.Scratch.Get "cli_tab_name") ">_ Redis CLI") }}
67

78
{{ if not (isset $.Site.Data.examples $id) }}
89
{{ warnf "[tabbed-clients-example] Example not found %q for %q" $id $.Page }}
@@ -12,7 +13,7 @@
1213
{{/* Render redis-cli example from inner content if any */}}
1314
{{ if (ne (trim $redisCommands "\n") "") }}
1415
{{ $redisCliContent := highlight (trim $redisCommands "\n") "plaintext" (printf "linenos=false,hl_lines=1-%d" $redisCommandsLineLimit ) }}
15-
{{ $tabs = $tabs | append (dict "title" "redis-cli" "content" $redisCliContent "limit" $redisCommandsLineLimit) }}
16+
{{ $tabs = $tabs | append (dict "title" "redis-cli" "displayName" $cliTabName "content" $redisCliContent "limit" $redisCommandsLineLimit) }}
1617
{{ end }}
1718

1819
{{ $clientExamples := index $.Site.Data.examples $id }}

layouts/partials/tabs/wrapper.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out"
2222
title="Open example" for="{{ $tid }}">
2323
{{ if eq (index $tab "title") "redis-cli" }}
24-
{{ $cliName }}
24+
{{ or (index $tab "displayName") $cliName }}
2525
{{ else }}
2626
{{ index $tab "title" }}
2727
{{ end }}

layouts/shortcodes/clients-example.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
{{ .Scratch.Set "step" (.Get 1) }}
33
{{ .Scratch.Set "lang" (.Get 2) }}
44
{{ .Scratch.Set "maxLines" (.Get 3) }}
5+
{{ .Scratch.Set "cli_tab_name" (.Get 4) }}
56
{{ .Scratch.Set "redisCommands" .Inner }}
67
{{ partial "tabbed-clients-example.html" . }}

0 commit comments

Comments
 (0)