Skip to content
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

Fix search for gatsby site #939

Merged
merged 1 commit into from
Nov 2, 2020
Merged

Fix search for gatsby site #939

merged 1 commit into from
Nov 2, 2020

Conversation

orta
Copy link
Member

@orta orta commented Nov 2, 2020

Roughly: The previous version of the site would load the page from scratch every time, so calling an external lib at the footer was a reasonable call. Gatsby on the other hand, won't do a full reliable re-render of a page and so when you're interacting with script tags etc. There needs to be a bit more dancing to hook stuff up.

This technique is almost C&P'd from the TypeScript website. A different potential fix is to move to the v3 docsearch implementation - microsoft/TypeScript-Website#928, which is done entirely within the bundler context and algolia have done a good job making it work in theses SPA-y sites.

For now this is enough to make it all work right

@orta
Copy link
Member Author

orta commented Nov 2, 2020

Screen Shot 2020-11-02 at 10 04 29 AM

@orta orta merged commit 24f7de4 into source Nov 2, 2020
@enisdenjo enisdenjo deleted the fix_search branch February 26, 2024 17:30
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.

1 participant