jquery / jquery-wp-content

WordPress themes and plugins for the jQuery sites
GNU General Public License v2.0
253 stars 169 forks source link

[documentation] Add a nice search experience to the website #416

Closed s-pace closed 6 years ago

s-pace commented 6 years ago

This PR 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.

If there is no result, pressing enter will enable the legacy search.

Ref Bootstraping PR as jquery/api.jquery.com#1104

jsf-clabot commented 6 years ago

CLA assistant check
All committers have signed the CLA.

s-pace commented 6 years ago

You can wait for our green light.

We will do an internal check in order to provide you a final PR soon

s-pace commented 6 years ago

On iPhone X: iPhone X

On iPad: iPad

On desktop:

desktop

Live demo of this PR

Please review it :)

s-pace commented 6 years ago

Thank you for the guidance @mgol. Sorry for the .DS_Store, removed ✅ Let us know if you need anything else

mgol commented 6 years ago

I've tested it now on https://api.jquery.com/ and it works absolutely awesome; such a nice experience. Wonderful work, thanks a lot! 👏

dmethvin commented 6 years ago

THIS IS AWESOME! 🎉 Many thanks @s-pace, and @mgol for getting this landed. Much better than the old search.

Krinkle commented 4 years ago

@s-pace Hi - is the API key added here part of an account we can access? The QUnit since has since switched to a static site where we push new content with a secret key during CI builds (ref https://github.com/qunitjs/qunit/issues/1460). As I wasn't able to find which account this key belongs to (e.g. to login and generate a secret key), we opted to create an ad-hoc personal account for now and use. However, I'd rather this not depend on a personal account long-term.

What do you recommend we do?

s-pace commented 4 years ago

👋 @Krinkle Please apply to DocSearch from this application form and we will make sure to grant you access to these analytics. The apiKey is not related to any account and it is a search only one that can be safely shared publicly.

Krinkle commented 4 years ago

@s-pace I don't think we need/want analytics. I'm referring to the secret key used in jekyll-algolia to push new content after an update. This is currently set jquery/qunit's Jenkins job in a secret ALGOLIA_API_KEY environment variable for post-commit builds on the main branch. These are generated from the logged-in Algolia account which is currently a personal one.

Would you recommend we just create another account like that, but with shared credentials stored in a safe place by OpenJS Foundation? Note that QUnit doesn't use docsearch.js, I don't know if what we use falls under "DocSearch", though.

s-pace commented 4 years ago

Thanks for the details. I thought that QUnit was still using DocSearch. I have disabled the daily crawl since this index is not used.

The account you are referring to is tied to @trentmwillis account. I would definitely recommend you to create a shared account with shared credentials stored in a safe place by the OpenJS foundation.