bloom-works / guides-template

Placeholder repo for work on Bloom Guides
https://bloom-guides-template.netlify.app/
MIT License
2 stars 0 forks source link

Search styles #18

Open jeffmaher opened 1 year ago

jeffmaher commented 1 year ago

Stories

Notes

Done When

jrubenoff commented 1 year ago

The search provider we choose will dictate the design here. So, last week, I researched static site search engines.

Here's what I came up with.

Algolia

This provider has a free plan that would give us 10K searches per month. StorybookJS and Tailwind use Algolia for their docs.

They have a search widget that seems to have some nice aria- attributes built in (although I haven't tested it in screen readers.) Here's what that looks like:

CleanShot 2023-06-13 at 15 50 17@2x

Alternatively, this tutorial for setting up Algolia on 11ty Serverless and Netlify offers a server-side approach that might be more performant.

To be honest, the Algolia docs seem a little intimidating for a project of this scope.

PageFind

I noticed that 11ty's docs use PageFind for client-side search. Unlike Algolia, I found it insanely easy to set up and customize. It took me half an hour to bootstrap an 11ty instance, install PageFind, and make this demo:

CleanShot 2023-06-13 at 15 57 28

A few big caveats:

Google / DuckDuckGo / etc.

The laziest approach would be to add an input that performs a site-specific search on a commercial search engine.

For example, if you were to search for "government", the Submit button could take you here:

CleanShot 2023-06-13 at 16 11 18@2x

This approach technically "works" but there are a few big issues:


@jeffmaher @SMakaiTakori Let me know what approach you think makes the most sense for this project!

jrubenoff commented 1 year ago

Just remembered a fourth option: Lunr

Here's a tutorial on setting it up with 11ty and Netlify Serverless.

The setup process seems similar to Algolia, but it's open source.

admoorgit commented 1 year ago

@jrubenoff capturing notes I took from convo with Jeff about search:

@jeffmaher feel free to add anything else that comes to mind

jeffmaher commented 1 year ago

@jrubenoff Continuing on Algolia prototype.

jrubenoff commented 1 year ago

Progress update:

bglw commented 1 year ago

Sneaking into this issue from Pagefind 👀

If it helps I'm happy to prioritize any accessibility work on the default UI. There's also a modular UI that does let you control the markup. Happy to help in any case.

SMakaiTakori commented 1 year ago
  • Algolia has this crawler for Netlify that creates a search index for the site, but you still have to manually integrate it with your static site and build the front-end.
  • I tried and failed to get this tutorial working due to various CLI errors. Maybe it's a problem with my dev environment because web searches on the issues I'm seeing turn up zero results.
  • If I have time, I'll create a non-functional markup / style pattern for search results in a branch.

Thank you for looking into this @jrubenoff , I reviewed the tutorial you shared and it does look like you have to do a good amount of manual setup for the results, which I feel shouldn't be a problem once we get there. If you have time, a style pattern for this would be great. Thanks!

jeffmaher commented 1 year ago

Josh is pushing up styles for the future search implementation, but Algolia didn't work out.

Also, switching the focus of this ticket to just be on styles and not the actual search tool itself. This helps us prioritize look and feel while Josh is around this week, and then the dev team can pick back up later.

jeffmaher commented 1 year ago

Thanks for the note @bglw ! We'll ping back in the issue if we wind up going with PageFind.

jeffmaher commented 1 year ago

Status update:

jeffmaher commented 1 year ago

Styles are in a PR, but we just need to figure ou the search engine to put it on top of.