mdx icon indicating copy to clipboard operation
mdx copied to clipboard

Add site search to the new MDX website

Open ChristianMurphy opened this issue 2 years ago • 3 comments

Subject of the feature

Have a way to search all documentation pages on the website.

Problem

Currently there is no way to search for specific content on the MDX site itself. Adopters either have to click through pages looking for where a relevant section is, or to go off the website to a search engine and do a site scoped search from there. For example if I'm looking for the Vue guide, I have go click through the site until I eventually find https://v2.mdxjs.com/packages/vue/#use several layers of navigation in.

Expected behavior

Have a way to search the documentation built into the site

Alternatives

  • Don't include search on the site
  • Add a link to a search engine with the site scope setup

Potential solutions

  • https://www.algolia.com/for-open-source
  • https://programmablesearchengine.google.com
  • https://ddg.patdryburgh.com
  • (many others, most search engines provide an embed-able site search)

ChristianMurphy avatar Oct 24 '21 23:10 ChristianMurphy

Algolia was used in the v1 site: https://github.com/mdx-js/mdx/blob/master/packages/gatsby-theme-mdx/src/components/search.js.

wooorm avatar Oct 25 '21 10:10 wooorm

This is probably the easiest way to integrate algolia to an OSS documentation site and probably this project can be listed on docsearch's homepage.

https://docsearch.algolia.com

mizozobu avatar Jan 27 '22 12:01 mizozobu

Hey there! I can confirm DocSearch was running for the v1 website, and we still have the setup up and running!

I've made a (really basic) update on our side just to make it work for the current website, csb - live demo

You can use the credentials you see on the sandbox, they are yours and public so no worry about disclosing it. For the account owner, I see @johno so let me know if I should send a new invite or add someone else :)

shortcuts avatar Dec 21 '22 09:12 shortcuts