Skip to content

Commit 352592e

Browse files
feat(docsearch): use relative URLs
1 parent ef3566f commit 352592e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/DocSearch.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,16 @@ export function DocSearch({
223223
return Object.values(
224224
groupBy(items, item => item.hierarchy.lvl1)
225225
)
226+
.map(items => {
227+
return items.map(item => {
228+
const url = new URL(item.url);
229+
230+
return {
231+
...item,
232+
url: item.url.replace(url.origin, ''),
233+
};
234+
});
235+
})
226236
.map(transformItems)
227237
.map(hits =>
228238
hits.map(item => {

0 commit comments

Comments
 (0)