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

add search box #73

Closed
orbeckst opened this issue Apr 25, 2018 · 4 comments · Fixed by #76
Closed

add search box #73

orbeckst opened this issue Apr 25, 2018 · 4 comments · Fixed by #76
Assignees
Labels
enhancement search site search, SEO

Comments

@orbeckst
Copy link
Member

It would be nice to be able to search the pages, especially the blog. Possibilities:

@orbeckst orbeckst self-assigned this Apr 25, 2018
@orbeckst
Copy link
Member Author

I am currently trying out DocSearch and will report back.... more comments welcome, of course.

You can see DocSearch in action at https://jekyllrb.com/ – e.g., type "search" into the search box.

@orbeckst
Copy link
Member Author

I applied for free DocSearch (2 days ago and again today):

Thank you !
We'll review your request shortly, after making sure your website is eligible to DocSearch.

This is a manual process and can take some time.

We'll then email you the code you need to integrate on your website

We'll see if they reply eventually. They promise

We’ll get back to you within a few hours with everything you need to integrate your new search into your website.
Oh, and did we mention it's FREE? No commitment. No subscription. Everything is on us! And it won't change.

@orbeckst
Copy link
Member Author

Algolia set up their crawler and we only have to add a search box to our site and include the following code:

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: '307d780013d06fdde7a4eae462db0e74', 
indexName: 'mdanalysis', 
inputSelector: '### REPLACE ME ####', 
debug: false // Set debug to true if you want to inspect the dropdown 
}); 
</script> 

- Add a search input in your page if you don't have any yet. Then update the inputSelector value in JS snippet to a CSS selector that targets your search input field. 

- Optionally customize the look and feel by following the DocSearch documentation (https://community.algolia.com/docsearch/documentation/) 
- You can also check your configuration in our github repo (https://github.com/algolia/docsearch-configs/blob/master/configs/mdanalysis.json). 

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. 

@orbeckst
Copy link
Member Author

orbeckst commented Apr 30, 2018

orbeckst added a commit that referenced this issue May 1, 2018
- closes #73
- uses Algolia free plan with configuration at
  https://github.com/algolia/docsearch-configs/blob/master/configs/mdanalysis.json
- Algolia index is updated every 24 hours.
- NOTE: needed to set site.baseurl to empty to make local testing work;
  according to https://byparker.com/blog/2014/clearing-up-confusion-around-baseurl/
  we do NOT need to use it.

  When running locally my installation failed to load local js and only after
  setting baseurl to empty would it work.
  (See #16 (comment))
richardjgowers pushed a commit that referenced this issue May 1, 2018
- closes #73
- uses Algolia free plan with configuration at
  https://github.com/algolia/docsearch-configs/blob/master/configs/mdanalysis.json
- Algolia index is updated every 24 hours.
- NOTE: needed to set site.baseurl to empty to make local testing work;
  according to https://byparker.com/blog/2014/clearing-up-confusion-around-baseurl/
  we do NOT need to use it.

  When running locally my installation failed to load local js and only after
  setting baseurl to empty would it work.
  (See #16 (comment))
@orbeckst orbeckst added the search site search, SEO label Jul 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement search site search, SEO
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant