Skip to content

Local Doc Search #1671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 23, 2021
Merged

Local Doc Search #1671

merged 4 commits into from
Mar 23, 2021

Conversation

hahmadia
Copy link
Contributor

No issues but this came out of personal frustration where docsearch would use typescriptlang.org instead of my localhost. I kept having to copy the url and paste it in my browser and replace it to localhost to go where I wanted. SO I looked up docsearch docs and made it so if your on localhost, it will use localhost instead of typescriptlang.org.

@orta
Copy link
Contributor

orta commented Mar 22, 2021

I'm hesitant for two reasons:

  • I really need to do the work to get Implement DocSearch v3 #928 in which would deprecate these changes
  • I don't want custom code for this running in prod, for example this might not allow ctrl + clicking to do a new tab and could interfere with the keyboard interactions

If you make it so that this custom handler only occurs in dev, I'm cool with it 👍🏻

@hahmadia
Copy link
Contributor Author

hahmadia commented Mar 23, 2021

Hey Orta,

So I've maded it such that our custom handler only runs if we are in a dev environment, otherwise undefined is passed and it will fallback on docsearches own handleSelected (https://github.com/algolia/docsearch/blob/7c1d293af9b828cf2553d7ea61c54eb78f4dc882/src/lib/DocSearch.js#L108)

Copy link
Contributor

@orta orta left a comment

Choose a reason for hiding this comment

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

Thanks!

@orta orta merged commit dd8a092 into microsoft:v2 Mar 23, 2021
@hahmadia hahmadia deleted the LocalDocSearch branch March 23, 2021 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants