Skip to content

Commit

Permalink
docs: search results now lead to open deployment instead of always go…
Browse files Browse the repository at this point in the history
…ing to prod
  • Loading branch information
hasparus committed Jun 7, 2021
1 parent f3484a4 commit 92686a0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/docs/src/index.js
Expand Up @@ -41,7 +41,6 @@ export const setDocSearchComponents = ({
type="text/javascript"
dangerouslySetInnerHTML={{
__html: `
var lastSearchInput = null;
var observer = new MutationObserver(function () {
var searchSelector = "#algolia-docs-search";
Expand All @@ -52,7 +51,15 @@ export const setDocSearchComponents = ({
apiKey: "84ed820927eee5fa5018c9f1abe70390",
indexName: "theme-ui",
inputSelector: searchSelector,
debug: true
debug: true,
transformData: function(hits) {
for (const hit of hits) {
hit.url = hit.url.replace(
"https://theme-ui.com",
window.location.origin
)
}
}
})
lastSearchInput = searchInput;
}
Expand Down

1 comment on commit 92686a0

@vercel
Copy link

@vercel vercel bot commented on 92686a0 Jun 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.