Skip to content

Commit 58b5eaf

Browse files
authored
Add Ask AI to Algolia results and add more filters to search results page (#266)
* Add Ask AI to Algolia results and add more filters to search results page * Move View all results to the bottom Do not submit AI question to allow users to refine Add preview of the search page * Update ui-model.yml * Pass on relevant products
1 parent 6292bf6 commit 58b5eaf

9 files changed

+352
-217
lines changed

preview-src/index.adoc

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ link:./cloud-api.html[Cloud API]
3434

3535
link:./playground.html[Playground]
3636

37+
== Site search
38+
39+
link:./search.html[Search]
40+
3741
== Tables
3842

3943
|===

preview-src/search.adoc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
= Search the Documentation
2+
:page-layout: search

preview-src/ui-model.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ antoraVersion: '1.0.0'
22
site:
33
url: http://localhost:5252
44
title: UI Preview
5-
homeUrl: &home_url /xyz/23.2/index.html
5+
homeUrl: &home_url /xyz/24.3/index.html
66
components:
77
- name: abc
88
title: Project ABC
@@ -28,8 +28,8 @@ site:
2828
- &component_version
2929
title: *component_title
3030
url: '#'
31-
version: '23.2'
32-
displayVersion: '23.2'
31+
version: '24.3'
32+
displayVersion: '24.3'
3333
- url: '#'
3434
version: '5.1'
3535
displayVersion: '5.1'
@@ -58,8 +58,8 @@ page:
5858
title: Brand’s Hardware & Software Requirements
5959
component: *component
6060
componentVersion: *component_version
61-
version: '23.2'
62-
displayVersion: '23.2'
61+
version: '24.3'
62+
displayVersion: '24.3'
6363
module: ROOT
6464
relativeSrcPath: index.adoc
6565
editUrl: http://example.com/project-xyz/blob/main/index.adoc
@@ -78,14 +78,14 @@ page:
7878
url: '#'
7979
urlType: internal
8080
- content: Brand’s Hardware & Software Requirements
81-
url: /xyz/23.2/index.html
81+
url: /xyz/24.3/index.html
8282
urlType: internal
8383
versions:
8484
- version: '6.0'
8585
displayVersion: '6.0'
8686
url: '#'
87-
- version: '23.2'
88-
displayVersion: '23.2'
87+
- version: '24.3'
88+
displayVersion: '24.3'
8989
url: '#'
9090
- version: '5.1'
9191
displayVersion: '5.1'
@@ -102,12 +102,12 @@ page:
102102
urlType: internal
103103
items:
104104
- content: Brand’s Hardware & Software Requirements
105-
url: /xyz/23.2/index.html
105+
url: /xyz/24.3/index.html
106106
urlType: internal
107107
- content: Cloud API
108-
url: /xyz/23.2/cloud-api.html
108+
url: /xyz/24.3/cloud-api.html
109109
urlType: internal
110110
- content: Bloblang Playground
111-
url: /xyz/23.2/playground.html
111+
url: /xyz/24.3/playground.html
112112
urlType: internal
113113

src/css/search.css

+49-6
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,46 @@ article.search .ais-Heading > a {
161161
color: var(--body-font-color);
162162
}
163163

164+
.aa-Header {
165+
display: flex;
166+
flex-direction: column;
167+
align-items: flex-start;
168+
gap: 8px; /* Space between the button and link */
169+
padding: 12px;
170+
}
171+
172+
.aa-Header .ask-ai {
173+
display: flex;
174+
align-items: center;
175+
background-color: rgb(225, 66, 37);
176+
box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 10px;
177+
border-radius: 10px;
178+
padding: 10px;
179+
border: none;
180+
color: white;
181+
height: 32px;
182+
font-size: var(--secondary-font-size);
183+
text-transform: none;
184+
}
185+
186+
.aa-Header .ask-ai svg {
187+
margin-right: 6px;
188+
}
189+
190+
.search-footer .view-all {
191+
color: var(--link-highlight-color);
192+
font-size: 16px;
193+
text-decoration: none;
194+
padding: 4px 0;
195+
cursor: pointer;
196+
margin-top: 10px;
197+
margin-bottom: 50px;
198+
}
199+
200+
.search-footer .view-all:hover {
201+
text-decoration: underline;
202+
}
203+
164204
.ais-Breadcrumbs a,
165205
.aa-Breadcrumbs a {
166206
color: var(--body-font-color);
@@ -294,7 +334,10 @@ kbd.algolia-command {
294334
}
295335

296336
.search-footer {
297-
display: none;
337+
display: flex;
338+
justify-content: space-evenly;
339+
flex-direction: column;
340+
padding: 10px;
298341
}
299342

300343
.aa-Footer {
@@ -308,6 +351,11 @@ kbd.algolia-command {
308351
display: block;
309352
}
310353

354+
.aa-DetachedContainer .aa-Panel {
355+
overflow: auto;
356+
height: fit-content;
357+
}
358+
311359
.aa-SourceFooter {
312360
position: sticky;
313361
bottom: -13px;
@@ -500,11 +548,6 @@ li.aa-Item:not([id*=filters]) {
500548
}
501549

502550
@media screen and (min-width: 900px) {
503-
.search-footer {
504-
display: flex;
505-
justify-content: space-evenly;
506-
}
507-
508551
.aa-Preview.aa-Column {
509552
display: flex;
510553
flex-direction: column;

src/css/vars.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ html[data-theme=dark] {
159159
--z-index-toolbar: 4;
160160
--z-index-navbar: 5;
161161
/* Algolia */
162-
--aa-detached-modal-max-width: 800px;
163-
--aa-spacing-factor: 1.3;
162+
--aa-detached-modal-max-width: 1200px;
163+
--aa-spacing-factor: 0.8;
164164
/* Prism */
165165
--highlight-background: rgba(255, 255, 0, 0.23);
166166
}

src/css/vendor/algolia/autocomplete-tags-plugin.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/css/vendor/algolia/autocomplete-theme-classic.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)