Skip to content

Commit

Permalink
feat(docsearch): use relative URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Apr 10, 2020
1 parent ef3566f commit 352592e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/DocSearch.tsx
Expand Up @@ -223,6 +223,16 @@ export function DocSearch({
return Object.values(
groupBy(items, item => item.hierarchy.lvl1)
)
.map(items => {
return items.map(item => {
const url = new URL(item.url);

return {
...item,
url: item.url.replace(url.origin, ''),
};
});
})
.map(transformItems)
.map(hits =>
hits.map(item => {
Expand Down

0 comments on commit 352592e

Please sign in to comment.