Skip to content

Commit b7e4c25

Browse files
thecrypticacereinink
authored andcommitted
Use Components for the Tailwind Plus component category
The actual title in Algolia is different temporarily. We’ll change this in the future.
1 parent 2c82d74 commit b7e4c25

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/components/search.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,10 @@ export function SearchProvider({ children }: React.PropsWithChildren) {
161161
return item
162162
})
163163

164+
// TODO: Remove this once only new stuff is indexed
164165
items = items.filter((item) => {
165166
// Remove old prev-Tailwind plus search results
167+
// @ts-ignore
166168
if (item.hierarchy?.lvl0 === "Components") {
167169
return false
168170
}
@@ -191,6 +193,16 @@ export function SearchProvider({ children }: React.PropsWithChildren) {
191193

192194
let isTailwindUI = isTailwindPlusURL(item.url);
193195

196+
if (isTailwindUI && item.hierarchy.lvl0 === "UI Blocks") {
197+
if (item.hierarchy?.lvl0) {
198+
item.hierarchy.lvl0 = "Components"
199+
}
200+
201+
if (item._highlightResult?.hierarchy?.lvl0?.value) {
202+
item._highlightResult.hierarchy.lvl0.value = "Components"
203+
}
204+
}
205+
194206
return {
195207
...item,
196208
hierarchy: {

0 commit comments

Comments
 (0)