Skip to content

Commit 1507a34

Browse files
Update single.html
1 parent f062b90 commit 1507a34

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

layouts/operate/single.html

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,37 @@ <h1>
1414
{{ end }}
1515
{{ .Title }}</h1>
1616
{{ with .Params.description }}<p class="text-lg -mt-5 mb-10">{{ . | markdownify }}</p>{{ end }}
17-
{{ if .Params.categories }}
17+
{{ if .Params.categories }}
1818
<div class="post-categories" style="display: table;">
1919
<table style="border-collapse: separate; border-spacing: 0; background-color: #ffffff;">
2020
<thead>
2121
<tr>
22-
<th style="border: 1px solid #ccc; padding: 8px; text-align: left; font-weight: normal; white-space: nowrap; border-top-left-radius: 10px; border-bottom-left-radius: 10px;">Applies to:</th> <!-- Added rounded corners for the first cell -->
23-
{{ range .Params.categories }}
22+
<th style="border: 1px solid #ccc; padding: 8px; text-align: left; font-weight: normal; white-space: nowrap; border-top-left-radius: 10px; border-bottom-left-radius: 10px;">Applies to:</th> <!-- Rounded corners for the first cell -->
23+
{{ $total := len .Params.categories }} <!-- Store the total number of categories -->
24+
{{ range $index, $element := .Params.categories }}
2425
{{ if not (in (slice "docs" "operate" "integrate" "develop") .) }} <!-- Exclude specific categories -->
25-
{{ $displayName := . }} <!-- Set default display name -->
26+
{{ $displayName := $element }} <!-- Set default display name -->
2627
{{ $color := "#000000" }} <!-- Default color (black) -->
27-
{{ if eq . "rs" }}
28+
{{ if eq $element "rs" }}
2829
{{ $displayName = "Redis Enterprise Software" }}
2930
{{ $color = "#DCFF1E" }} <!-- Yellow bullet point for Redis Enterprise Software -->
30-
{{ else if eq . "rc" }}
31+
{{ else if eq $element "rc" }}
3132
{{ $displayName = "Redis Cloud" }}
3233
{{ $color = "#80DBFF" }} <!-- Blue bullet point for Redis Cloud -->
33-
{{ else if eq . "kubernetes" }}
34+
{{ else if eq $element "kubernetes" }}
3435
{{ $displayName = "Redis Enterprise for Kubernetes" }}
3536
{{ $color = "#8A99A0" }} <!-- Light grey bullet point for Kubernetes -->
36-
{{ else if eq . "oss" }}
37+
{{ else if eq $element "oss" }}
3738
{{ $displayName = "Redis Source Available" }}
3839
{{ $color = "#C795E3" }} <!-- Purple bullet point for Redis Source Available -->
39-
{{ else if eq . "stack" }}
40+
{{ else if eq $element "stack" }}
4041
{{ $displayName = "Redis Stack" }}
4142
{{ $color = "#49859C" }} <!-- Medium blue bullet point for Redis Stack -->
42-
{{ else if eq . "redisinsight" }}
43+
{{ else if eq $element "redisinsight" }}
4344
{{ $displayName = "Redis Insight" }}
4445
{{ $color = "#FD4439" }} <!-- Red bullet point for Redis Insight -->
4546
{{ end }}
46-
{{ $last := eq (add 1 (index $.Params.categories)) (len $.Params.categories) }} <!-- Check if it is the last category -->
47-
<th style="border: 1px solid #ccc; padding: 8px; text-align: left; font-weight: normal; {{ if $last }}border-top-right-radius: 10px; border-bottom-right-radius: 10px;{{ end }}">
47+
<th style="border: 1px solid #ccc; padding: 8px; text-align: left; font-weight: normal; {{ if eq $index (sub $total 1) }}border-top-right-radius: 10px; border-bottom-right-radius: 10px;{{ end }}">
4848
<span style="color: {{ $color }}; font-size: 20px;">&#8226;</span> <!-- Larger colored bullet point -->
4949
{{ $displayName }}
5050
</th>
@@ -64,6 +64,7 @@ <h1>
6464

6565

6666

67+
6768
<!-- In-page banner -->
6869
{{ if .Params.bannerText }}
6970
<!-- Banner params are in the current page's front matter -->

0 commit comments

Comments
 (0)