|
7 | 7 | </a>
|
8 | 8 | </div>
|
9 | 9 |
|
10 |
| - <div class="header__product-selector">Product Selector</div> |
| 10 | + <div class="header__product-selector"> |
| 11 | + {{ $nginxProducts := slice |
| 12 | + (dict "title" "NGINX One Console" "url" "/nginx-one" "type" "nginx-one") |
| 13 | + (dict "title" "NGINX Plus" "url" "/nginx" "type" "nginx-one") |
| 14 | + (dict "title" "NGINX Instance Manager" "url" "/nginx-instance-manager" "type" "nginx-one") |
| 15 | + (dict "title" "NGINX Ingress Controller" "url" "/nginx-ingress-controller" "type" "nginx-one") |
| 16 | + (dict "title" "NGINX Gateway Fabric" "url" "/nginx-gateway-fabric" "type" "nginx-one") |
| 17 | + (dict "title" "NGINX Open Source" "url" "https://nginx.org/en/docs/" "type" "nginx-one") |
| 18 | + (dict "title" "NGINX Agent" "url" "/nginx-agent" "type" "nginx-one") |
| 19 | + (dict "title" "NGINX App Protect WAF" "url" "/nginx-app-protect-waf" "type" "nginx-app-protect") |
| 20 | + (dict "title" "NGINX App Protect DoS" "url" "/nginx-app-protect-dos" "type" "nginx-app-protect") |
| 21 | + (dict "title" "NGINX as a Service for Azure" "url" "/nginxaas/azure/" "type" "nginx-as-a-service") |
| 22 | + (dict "title" "NGINX Unit" "url" "https://unit.nginx.org/" "type" "nginx-other") |
| 23 | + }} |
| 24 | + {{ $productMap := dict }} |
| 25 | + {{ range $nginxProducts }} |
| 26 | + {{ $productId := index (split .url "/") 1 }} |
| 27 | + {{ $productMap = merge $productMap (dict $productId .title) }} |
| 28 | + {{ end }} |
| 29 | + {{ $relPermalink := .RelPermalink }} |
| 30 | + {{ $productIdentifier := index ((split $relPermalink "/")) 1 }} |
| 31 | + {{ $productName := index $productMap $productIdentifier }} |
| 32 | + |
| 33 | + <button class="product-selector__button" id="product-selector-button"> |
| 34 | + {{/* product name and selector */}} |
| 35 | + <span class="product-name">{{ $productName }}</span> |
| 36 | + <span class="product-selector-button-icon"> |
| 37 | + <svg width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 38 | + <path d="M1 13L7 7L0.999999 1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> |
| 39 | + </svg> |
| 40 | + </span> |
| 41 | + </button> |
| 42 | + <div class="product-selector" id="product-selector"> |
| 43 | + {{ $groupedProducts := dict |
| 44 | + "nginx-one" (where $nginxProducts "type" "nginx-one") |
| 45 | + "nginx-app-protect" (where $nginxProducts "type" "nginx-app-protect") |
| 46 | + "nginx-as-a-service" (where $nginxProducts "type" "nginx-as-a-service") |
| 47 | + "nginx-other" (where $nginxProducts "type" "nginx-other") |
| 48 | + }} |
| 49 | + {{ $orderedKeys := slice "nginx-one" "nginx-app-protect" "nginx-as-a-service" "nginx-other" }} |
| 50 | + {{ range $orderedKeys }} |
| 51 | + {{ $type := . }} |
| 52 | + {{ $products := index $groupedProducts $type }} |
| 53 | + <div class="product-selector-content" id="product-selector-content"> |
| 54 | + <p>{{ $type | humanize | title | upper }}</p> |
| 55 | + <ul> |
| 56 | + {{ range $products }} |
| 57 | + <li> |
| 58 | + <a href="{{ .url }}">{{ .title }}</a> |
| 59 | + </li> |
| 60 | + {{ end }} |
| 61 | + </ul> |
| 62 | + </div> |
| 63 | + {{ end }} |
| 64 | + </div> |
| 65 | + |
| 66 | + |
| 67 | + </div> |
11 | 68 |
|
12 | 69 | {{ if ( not ( in .Site.Params.buildtype "package" ) ) }}
|
13 | 70 | <div class="header__search">
|
|
0 commit comments