Skip to content

Commit

Permalink
feat: upgrade docsearch version (#441)
Browse files Browse the repository at this point in the history
  • Loading branch information
posva authored Nov 16, 2021
1 parent ea6cb00 commit 1b245e2
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 104 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
"url": "https://github.com/vuejs/vitepress/issues"
},
"dependencies": {
"@docsearch/css": "^1.0.0-alpha.28",
"@docsearch/js": "^1.0.0-alpha.28",
"@docsearch/css": "^3.0.0-alpha.41",
"@docsearch/js": "^3.0.0-alpha.41",
"@vitejs/plugin-vue": "^1.9.0",
"prismjs": "^1.25.0",
"vite": "^2.6.5",
Expand Down
211 changes: 114 additions & 97 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions src/client/theme-default/components/AlgoliaSearchBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,17 @@ function initialize(userOptions: any) {
}),
navigator: {
navigate: ({ suggestionUrl }: { suggestionUrl: string }) => {
navigate: ({ itemUrl }: { itemUrl: string }) => {
const { pathname: hitPathname } = new URL(
window.location.origin + suggestionUrl
window.location.origin + itemUrl
)
// Router doesn't handle same-page navigation so we use the native
// browser location API for anchor navigation
if (route.path === hitPathname) {
window.location.assign(window.location.origin + suggestionUrl)
window.location.assign(window.location.origin + itemUrl)
} else {
router.go(suggestionUrl)
router.go(itemUrl)
}
}
},
Expand Down Expand Up @@ -148,7 +148,8 @@ function initialize(userOptions: any) {
router.go(relativeHit)
},
children
}
},
__v: null
}
}
})
Expand Down

0 comments on commit 1b245e2

Please sign in to comment.