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 to API site #1460

Closed
3 tasks done
Krinkle opened this issue Jul 12, 2020 · 1 comment
Closed
3 tasks done

Add search to API site #1460

Krinkle opened this issue Jul 12, 2020 · 1 comment
Assignees
Labels
Category: Docs Type: Enhancement New idea or feature request.

Comments

@Krinkle
Copy link
Member

Krinkle commented Jul 12, 2020

We can use the same method as for the main site, using Algolia.

Tentatively:

And as part of #1458, naturally, to also display the search bar on the API site itself.

@Krinkle Krinkle self-assigned this Jul 12, 2020
@Krinkle Krinkle added Category: Docs Type: Enhancement New idea or feature request. and removed Category: API labels Jul 12, 2020
@Krinkle
Copy link
Member Author

Krinkle commented Jul 14, 2020

Before After
before after

This was referenced Jul 21, 2020
Krinkle added a commit to qunitjs/jekyll-theme-amethyst that referenced this issue Jul 26, 2020
* Add a second autocomplete source for the 'qunitjs-api'
  Algolia index that exits as of
  qunitjs/qunit@2486b22829d5e.

* Fix its URLs to start with https://api.qunitjs.com as otherwise
  the links are 404 Not Found. The indexer part of jekyll-algolia
  indexes based on local context only. This means it can index
  new content during the Travis build, but also means it's not
  aware of the "real" URL when queried from a sibling site.
  There might be an official way to do this, but I couldn't find
  one.

* Fix the empty() template for "No results"  to be part of the
  shared 'templates' options rather than per-source as otherwise
  the message will render twice if neither index has results.

* Change the '& + &' border-top rule for lines between results
  to now be at the top of all results including the first one.
  This is needed because each source has its own aa-suggestions
  wrapper and thus the line between the last API result and first
  main site result would otherwise be missing.
  The line is subtle enough that it seems invisible to me at
  the edge between white and dark purple, but we could make it
  more invisible with a negative margin, or with some more
  elaborate selectors or by somehow making autocomplete.js merge
  the results before rendering. I haven't done either for now as
  this seems simpler and good enough.

Other improvements:

* Make use of the heading information from Algolia's index.
  The makes results render as:

  - Plugins › qunit-assert-step
    A QUnit plugin for asserting the proper sequence…

  Instead of:

  - Plugins
    A QUnit plugin for asserting the proper sequence…

* Make use of the anchor information from Algolia's index.
  This makes the result URL and its on-click behaviour
  jump straight to the relevant heading.

* Remove `<div class="aa-empty">` wrapper. It seems autocomplete.js
  already does this, which mean it was actually generating
  div.aa-empty>div.aa-empty and thus a double margin.
  This was fixed.

* Exclude the no-js /guides/ page from the index since it only
  contains summaries of the pages it links to and distracts
  in results.

Closes qunitjs/qunit#1460.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Docs Type: Enhancement New idea or feature request.
Development

No branches or pull requests

1 participant