Skip to content

Commit 114e537

Browse files
committed
Sidebar: Move search to top of mobile view, remove selector
1 parent 70f2f6f commit 114e537

File tree

1 file changed

+3
-63
lines changed

1 file changed

+3
-63
lines changed

layouts/partials/sidebar-v2.html

Lines changed: 3 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,11 @@
11

22
<div class="sidebar__container">
33
<div class="sidebar__header">
4-
<div class="sidebar__img">
5-
<img class="" src="{{ "/images/icons/NGINX-Open-Source-product-icon.svg" | absURL }}" alt="NGINX Docs">
4+
<div class="sidebar__search">
5+
<!-- Standalone search box. -->
6+
{{ partial "coveo-atomic-search.html" (dict "id" "search-standalone-sidebar") }}
67
</div>
7-
<div class="header__product-selector">
8-
{{ $nginxProducts := slice
9-
(dict "title" "NGINX One Console" "url" "/nginx-one" "type" "nginx-one")
10-
(dict "title" "NGINX Plus" "url" "/nginx" "type" "nginx-one")
11-
(dict "title" "NGINX Instance Manager" "url" "/nginx-instance-manager" "type" "nginx-one")
12-
(dict "title" "NGINX Ingress Controller" "url" "/nginx-ingress-controller" "type" "nginx-one")
13-
(dict "title" "NGINX Gateway Fabric" "url" "/nginx-gateway-fabric" "type" "nginx-one")
14-
(dict "title" "NGINX Open Source" "url" "https://nginx.org/en/docs/" "type" "nginx-one")
15-
(dict "title" "NGINX Agent" "url" "/nginx-agent" "type" "nginx-one")
16-
(dict "title" "NGINX App Protect WAF" "url" "/nginx-app-protect-waf" "type" "nginx-app-protect")
17-
(dict "title" "NGINX App Protect DoS" "url" "/nginx-app-protect-dos" "type" "nginx-app-protect")
18-
(dict "title" "NGINX as a Service for Azure" "url" "/nginxaas/azure/" "type" "nginx-as-a-service")
19-
(dict "title" "NGINX Unit" "url" "https://unit.nginx.org/" "type" "nginx-other")
20-
}}
21-
{{ $productMap := dict }}
22-
{{ range $nginxProducts }}
23-
{{ if not (or (eq .title "NGINX Open Source" ) (eq .title "NGINX Unit")) }}
24-
{{ $productId := index (split .url "/") 1 }}
25-
{{ $productMap = merge $productMap (dict $productId .title) }}
26-
{{ end }}
27-
{{ end }}
28-
{{ $relPermalink := .RelPermalink }}
29-
{{ $productIdentifier := index ((split $relPermalink "/")) 1 }}
30-
{{ $productName := index $productMap $productIdentifier | default "Product Documentation" }}
318

32-
<button class="product-selector__button" id="product-selector-button">
33-
{{/* product name and selector */}}
34-
<span class="product-name">{{ $productName }}</span>
35-
<span class="product-selector-button-icon">
36-
<svg width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg">
37-
<path d="M1 13L7 7L0.999999 1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
38-
</svg>
39-
</span>
40-
</button>
41-
<div class="product-selector" id="product-selector" style="display: none">
42-
{{ $groupedProducts := dict
43-
"nginx-one" (where $nginxProducts "type" "nginx-one")
44-
"nginx-app-protect" (where $nginxProducts "type" "nginx-app-protect")
45-
"nginx-as-a-service" (where $nginxProducts "type" "nginx-as-a-service")
46-
"nginx-other" (where $nginxProducts "type" "nginx-other")
47-
}}
48-
{{ $orderedKeys := slice "nginx-one" "nginx-app-protect" "nginx-as-a-service" "nginx-other" }}
49-
{{ range $orderedKeys }}
50-
{{ $type := . }}
51-
{{ $products := index $groupedProducts $type }}
52-
<div class="product-selector-content" id="product-selector-content">
53-
<p>{{ $type | humanize | title | upper }}</p>
54-
<ul>
55-
{{ range $products }}
56-
<li>
57-
<a href="{{ .url }}">{{ .title }}</a>
58-
</li>
59-
{{ end }}
60-
</ul>
61-
</div>
62-
{{ end }}
63-
</div>
64-
</div>
659

6610

6711
</div>
@@ -76,10 +20,6 @@
7620
"idPrefix" ""
7721
) }}
7822
</div>
79-
<div class="sidebar__search">
80-
<!-- Standalone search box. -->
81-
{{ partial "coveo-atomic-search.html" (dict "id" "search-standalone-sidebar") }}
82-
</div>
8323
</div>
8424

8525
</div>

0 commit comments

Comments
 (0)