Skip to content

Commit 5ff8018

Browse files
Merge pull request #270 from redis/categories
Use categories to identify products on each content page
2 parents 02da4c1 + 11395cb commit 5ff8018

File tree

5 files changed

+115
-7
lines changed

5 files changed

+115
-7
lines changed

content/operate/oss_and_stack/_index.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,12 @@
22
title: Redis Community Edition and Stack
33
description: Operate Redis Community Edition and Redis Stack. Redis OSS was renamed Redis Community Edition (CE) with the v7.4 release.
44
linkTitle: Redis Community Edition and Stack
5-
---
5+
6+
categories:
7+
- docs
8+
- operate
9+
- oss
10+
- stack
11+
---
12+
13+

content/operate/redisinsight/_index.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
title: Redis Insight
33
description: Install and manage Redis Insight
44
linkTitle: Redis Insight
5+
categories:
6+
- docs
7+
- operate
8+
- redisinsight
59
---
610

7-
For information on using Redis Insight, see [these pages]({{< relref "/develop/tools/insight" >}}).
11+
For information on using Redis Insight, see [these pages]({{< relref "/develop/tools/insight" >}}).
12+

layouts/_default/single.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ <h1>{{ .Title }}</h1>
88
</section>
99

1010
</main>
11-
{{ end }}
11+
{{ end }}

layouts/operate/list.html

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,53 @@ <h1>
1515
{{ .Title }}
1616
</h1>
1717

18-
{{ with .Params.description }}<p class="text-lg -mt-5 mb-10">{{ . | markdownify }}</p>{{ end }}
19-
18+
{{ with .Params.description }}<p class="text-lg -mt-2 mb-2">{{ . | markdownify }}</p>{{ end }}
19+
{{ if .Params.categories }}
20+
<div class="post-categories" style="display: table;">
21+
<table style="border-collapse: separate; border-spacing: 0; background-color: #ffffff;">
22+
<thead>
23+
<tr>
24+
{{ $visibleCategories := slice }}
25+
{{ range .Params.categories }}
26+
{{ if not (in (slice "docs" "operate" "integrate" "develop") .) }}
27+
{{ $visibleCategories = $visibleCategories | append (slice .) }} <!-- Corrected Append -->
28+
{{ end }}
29+
{{ end }}
30+
{{ range $index, $element := $visibleCategories }}
31+
{{ $displayName := $element }}
32+
{{ $color := "#ffffff" }} <!-- Default background color (white) -->
33+
{{ if eq $element "rs" }}
34+
{{ $displayName = "Redis Enterprise Software" }}
35+
{{ $color = "#DCFF1E" }}
36+
{{ else if eq $element "rc" }}
37+
{{ $displayName = "Redis Cloud" }}
38+
{{ $color = "#80DBFF" }}
39+
{{ else if eq $element "kubernetes" }}
40+
{{ $displayName = "Redis Enterprise for Kubernetes" }}
41+
{{ $color = "#8A99A0" }}
42+
{{ else if eq $element "oss" }}
43+
{{ $displayName = "Redis Community Edition" }}
44+
{{ $color = "#C795E3" }}
45+
{{ else if eq $element "stack" }}
46+
{{ $displayName = "Redis Stack" }}
47+
{{ $color = "#49859C" }}
48+
{{ else if eq $element "redisinsight" }}
49+
{{ $displayName = "Redis Insight" }}
50+
{{ $color = "#FD4439" }}
51+
{{ end }}
52+
<th style="border: 1px solid #ccc; padding: 8px; text-align: left; font-weight: normal; background-color: {{ $color }}; {{ if eq $index 0 }}border-top-left-radius: 10px; border-bottom-left-radius: 10px;{{ end }}{{ if eq $index (sub (len $visibleCategories) 1) }}border-top-right-radius: 10px; border-bottom-right-radius: 10px;{{ end }}">
53+
{{ $displayName }}
54+
</th>
55+
{{ end }}
56+
</tr>
57+
</thead>
58+
<tbody>
59+
<!-- The tbody is intentionally left empty as all content is in the header -->
60+
</tbody>
61+
</table>
62+
</div>
63+
{{ end }}
64+
2065
<!-- In-page banner -->
2166
{{ if .Params.bannerText }}
2267
<!-- Banner params are in the current page's front matter -->

layouts/operate/single.html

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,58 @@ <h1>
1313
{{ partial "icons/logo-stack.html" (dict "context" . "class" "stack-logo-inline") }}
1414
{{ end }}
1515
{{ .Title }}</h1>
16-
{{ with .Params.description }}<p class="text-lg -mt-5 mb-10">{{ . | markdownify }}</p>{{ end }}
17-
16+
{{ with .Params.description }}<p class="text-lg -mt-2 mb-2">{{ . | markdownify }}</p>{{ end }}
17+
{{ if .Params.categories }}
18+
<div class="post-categories" style="display: table;">
19+
<table style="border-collapse: separate; border-spacing: 0; background-color: #ffffff;">
20+
<thead>
21+
<tr>
22+
{{ $visibleCategories := slice }}
23+
{{ range .Params.categories }}
24+
{{ if not (in (slice "docs" "operate" "integrate" "develop") .) }}
25+
{{ $visibleCategories = $visibleCategories | append (slice .) }} <!-- Corrected Append -->
26+
{{ end }}
27+
{{ end }}
28+
{{ range $index, $element := $visibleCategories }}
29+
{{ $displayName := $element }}
30+
{{ $color := "#ffffff" }} <!-- Default background color (white) -->
31+
{{ if eq $element "rs" }}
32+
{{ $displayName = "Redis Enterprise Software" }}
33+
{{ $color = "#DCFF1E" }}
34+
{{ else if eq $element "rc" }}
35+
{{ $displayName = "Redis Cloud" }}
36+
{{ $color = "#80DBFF" }}
37+
{{ else if eq $element "kubernetes" }}
38+
{{ $displayName = "Redis Enterprise for Kubernetes" }}
39+
{{ $color = "#8A99A0" }}
40+
{{ else if eq $element "oss" }}
41+
{{ $displayName = "Redis Community Edition" }}
42+
{{ $color = "#C795E3" }}
43+
{{ else if eq $element "stack" }}
44+
{{ $displayName = "Redis Stack" }}
45+
{{ $color = "#49859C" }}
46+
{{ else if eq $element "redisinsight" }}
47+
{{ $displayName = "Redis Insight" }}
48+
{{ $color = "#FD4439" }}
49+
{{ end }}
50+
<th style="border: 1px solid #ccc; padding: 8px; text-align: left; font-weight: normal; background-color: {{ $color }}; {{ if eq $index 0 }}border-top-left-radius: 10px; border-bottom-left-radius: 10px;{{ end }}{{ if eq $index (sub (len $visibleCategories) 1) }}border-top-right-radius: 10px; border-bottom-right-radius: 10px;{{ end }}">
51+
{{ $displayName }}
52+
</th>
53+
{{ end }}
54+
</tr>
55+
</thead>
56+
<tbody>
57+
<!-- The tbody is intentionally left empty as all content is in the header -->
58+
</tbody>
59+
</table>
60+
</div>
61+
{{ end }}
62+
63+
64+
65+
66+
67+
1868
<!-- In-page banner -->
1969
{{ if .Params.bannerText }}
2070
<!-- Banner params are in the current page's front matter -->

0 commit comments

Comments
 (0)