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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(website): add DocSearch as recommended by docusaurus. #111

Open
s-pace opened this issue Feb 20, 2020 · 4 comments
Open

feat(website): add DocSearch as recommended by docusaurus. #111

s-pace opened this issue Feb 20, 2020 · 4 comments

Comments

@s-pace
Copy link

s-pace commented Feb 20, 2020

馃憢 team,

I am working on DocSearch. We have an integration for Docusaurus. We thought it is a shame you can not also used this search that you can find on reactjs for example.

Where is the website source code? I wan to do a PR which will add DocSearch to the documentation website. It will allow an user to have a learn-as-you-type experience by displaying results thanks to a dropdown in a live way.

Let me know if you need anything.

@zamotany
Copy link
Owner

Hey @s-pace, thank for reaching out but I'm not longer using Docusaurus for the website. I've switched to Docsify.

@s-pace
Copy link
Author

s-pace commented Apr 30, 2020

Alright. Do you want me to update it to Docsify then?

@zamotany
Copy link
Owner

Sure would be awesome! 馃憤
Let me know if you need anything from me

@s-pace
Copy link
Author

s-pace commented Apr 30, 2020

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:

  • Copy the following CSS/JS snippets and add them to your page
<!-- 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: 'f21790e191b394baced90e46598a70a7',
  indexName: 'react-slate',
  inputSelector: '### REPLACE ME ####',
  debug: false // Set debug to true if you want to inspect the dropdown
});
</script>

Please open a pull request if want to leverage your configuration!

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 :)

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

No branches or pull requests

2 participants