Skip to content

Commit 1f66607

Browse files
lamATnginxnginx-jack
authored andcommitted
feat: changed text on product name to be dynamic
1 parent 9593f3c commit 1f66607

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
lines changed

assets/css/v2/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ nav {
361361
margin-left: 0;
362362
padding-left: 0;
363363
list-style-type: none;
364+
padding-right: 1.5rem;
364365
}
365366

366367
.sidebar ul :not(.sidebar-navigation) ul {

layouts/partials/sidebar-v2.html

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
1+
{{ $nginxProducts := slice
2+
(dict "title" "NGINX One Console" "url" "/nginx-one" "type" "nginx-one")
3+
(dict "title" "NGINX Plus" "url" "/nginx" "type" "nginx-one")
4+
(dict "title" "NGINX Instance Manager" "url" "/nginx-instance-manager" "type" "nginx-one")
5+
(dict "title" "NGINX Ingress Controller" "url" "/nginx-ingress-controller" "type" "nginx-one")
6+
(dict "title" "NGINX Gateway Fabric" "url" "/nginx-gateway-fabric" "type" "nginx-one")
7+
(dict "title" "NGINX Open Source" "url" "https://nginx.org/en/docs/" "type" "nginx-one")
8+
(dict "title" "NGINX Agent" "url" "/nginx-agent" "type" "nginx-one")
9+
(dict "title" "NGINX App Protect WAF" "url" "/nginx-app-protect-waf" "type" "nginx-app-protect")
10+
(dict "title" "NGINX App Protect DoS" "url" "/nginx-app-protect-dos" "type" "nginx-app-protect")
11+
(dict "title" "NGINX as a Service for Azure" "url" "/nginxaas/azure/" "type" "nginx-as-a-service")
12+
(dict "title" "NGINX Unit" "url" "https://unit.nginx.org/" "type" "nginx-other")
13+
}}
14+
{{ $productMap := dict }}
15+
{{ range $nginxProducts }}
16+
{{ $productId := index (split .url "/") 1 }}
17+
{{ $productMap = merge $productMap (dict $productId .title) }}
18+
{{ end }}
19+
{{ $relPermalink := .RelPermalink }}
20+
{{ $productIdentifier := index ((split $relPermalink "/")) 1 }}
21+
{{ $productName := index $productMap $productIdentifier }}
122

223
<button class="product-selector-button" id="product-selector-button">
324
{{/* product name and selector */}}
4-
<div class="product-name">NGINX Plus</div>
25+
<div class="product-name">{{ $productName }}</div>
526
<div class="product-selector-button-icon">
627
<svg width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg">
728
<path d="M1 13L7 7L0.999999 1" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
829
</svg>
930
</div>
1031
</button>
1132
<div class="product-selector" id="product-selector">
12-
{{ $nginxProducts := slice
13-
(dict "title" "NGINX One Console" "url" "/nginx-one" "type" "nginx-one")
14-
(dict "title" "NGINX Plus" "url" "/nginx" "type" "nginx-one")
15-
(dict "title" "NGINX Instance Manager" "url" "/nginx-instance-manager" "type" "nginx-one")
16-
(dict "title" "NGINX Ingress Controller" "url" "/nginx-ingress-controller" "type" "nginx-one")
17-
(dict "title" "NGINX Gateway Fabric" "url" "/nginx-gateway-fabric" "type" "nginx-one")
18-
(dict "title" "NGINX Open Source" "url" "https://nginx.org/en/docs/" "type" "nginx-one")
19-
(dict "title" "NGINX Agent" "url" "/nginx-agent" "type" "nginx-one")
20-
(dict "title" "NGINX App Protect WAF" "url" "/nginx-app-protect-waf" "type" "nginx-app-protect")
21-
(dict "title" "NGINX App Protect DoS" "url" "/nginx-app-protect-dos" "type" "nginx-app-protect")
22-
(dict "title" "NGINX as a Service for Azure" "url" "/nginxaas/azure/" "type" "nginx-as-a-service")
23-
(dict "title" "NGINX Unit" "url" "https://unit.nginx.org/" "type" "nginx-other")
24-
}}
2533
{{ $groupedProducts := dict
2634
"nginx-one" (where $nginxProducts "type" "nginx-one")
2735
"nginx-app-protect" (where $nginxProducts "type" "nginx-app-protect")

0 commit comments

Comments
 (0)