-
Notifications
You must be signed in to change notification settings - Fork 301
add docsearch #184
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
add docsearch #184
Conversation
Deploy preview for es-reactjs ready! Built with commit c3a73e6 |
Searching for text inside works, but if you try to search for a header, it takes you here: https://es.reactjs.org/docs/hooks-intro.html#___gatsby |
👋 @tesseralis, The redirection to the anchor . You can find more details here. This is the same behaviour on Reactjs by the way.
Can you set one of these attribute to the |
@s-pace Ah, I see. It also seems like the main React docs don't allow you to search for the top level header? (e.g. you can't look up the page "Getting Started"). I'll raise the issue in the main react repo for now. Until then, @carburo @Darking360 I think this can be merged. |
@s-pace, is it possible to have the h1s link to the root page instead of an anchor? For example, searching "Getting started" should take you to reactjs.org/docs/getting-started.html instead of reactjs.org/docs/getting-started.html#getting-started. Is this what the lvl0 container is for? |
@tesseralis regarding your questions:
Actually it does, the highlighted part of the header is just not different. You can see an example on the main page for the query This is due to the version of the DocSearch UI being used. By comparison, with the latest version of the dropdown, you do have this highlighting:
This would be possible by using this handleSelected function. Adding a unique identifier to every |
There's currently a bug where links to anchors don't actually work (try searching once the netlify build deploys). It goes to
#__gatsby
, which is the top level id. It might have something to do with the differences in config between react and reactjs_es.@s-pace maybe you can help us get this working?