Skip to content

Commit

Permalink
fix: make algolia search work with indices that don't return absolute…
Browse files Browse the repository at this point in the history
… urls (#2956)

closes #336, closes #805
  • Loading branch information
frederic-schwarz committed Sep 13, 2023
1 parent d1d985e commit 2a34c6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client/theme-default/components/VPAlgoliaSearchBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ function initialize(userOptions: DefaultTheme.AlgoliaSearchOptions) {
docsearch(options)
}
function getRelativePath(absoluteUrl: string) {
const { pathname, hash } = new URL(absoluteUrl)
function getRelativePath(url: string) {
const { pathname, hash } = new URL(url, location.origin)
return (
pathname.replace(
/\.html$/,
Expand Down

0 comments on commit 2a34c6b

Please sign in to comment.