I love how the React and Flow docs do their search, I think that's using Algolia? We should have the search input on every page, so it'll likely have to sit in the nav bar at the top, ref #83.
~For now it'd be fine to only live on docs pages in the sidebar though, don't let yourself be blocked by #83!~
Update: There's a search component ready for the nav bar.
@mxstbr I checked Flow and it's using Algolia. How do you want results to be? I think Flow results box are a bit overhead for styled-components, isn't it? I'd like to implement it.
I quite like the flow result box, but feel free to experiment and come up with something better!
I found this: https://github.com/algolia/docsearch I'm pretty sure it's what Webpack, Babel, React and others use. How is it?
Let's do it!
@mxstbr @philpl I need to inject a small JS into the docs page so Algolia team can scrape our site and then I can go forward with the search component.
Sounds great!
This is the reply I got from Algolia team (I thought it's good to have it here too):
Hi Mohammad,
Congratulations, your search is now ready!
I've successfully configured the underlying crawler and it will now run every 24h.
You're now a few steps away from having it working on your website:
<!-- at the end of the HEAD -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
<!-- at the end of the BODY -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
<script type="text/javascript"> docsearch({
apiKey: '79886fb59ad3ebe2002b481cffbbe7cb',
indexName: 'styled-components',
inputSelector: '### REPLACE ME ####',
debug: false // Set debug to true if you want to inspect the dropdown
});
</script>
Feel free to get back to us if you have any issues or questions regarding the integration.
We'd also be happy to get your feedback and thoughts about DocSearch - so we can continue to improve it.
Have a nice day :)
I'll try setting it up tomorrow.
馃憣
@morajabi need any help getting this wrapped up?
This was done actually, but I think we had a minor problem on mobile and we hold it? @mxstbr Am I recalling correctly?
Fixed as of #310
Most helpful comment
I found this: https://github.com/algolia/docsearch I'm pretty sure it's what Webpack, Babel, React and others use. How is it?