website icon indicating copy to clipboard operation
website copied to clipboard

Add a search box

Open Putnam14 opened this issue 7 years ago • 7 comments

Since there are now enough episodes of Syntax for topics to get buried and become difficult to search for manually, I think Syntax deserves a search bar.

Background I wanted to find out which domain registrar Wes and Scott recommend. I figured there would be a search bar on their website. There was not.

Recommendation Add a search bar to the upper right corner, or in the navbar. I would suggest using an implementation of fuzzy search such as Fuse.js.

Putnam14 avatar Aug 08 '18 00:08 Putnam14

planning on this!

For the time being, you can search all the show notes in google with something like domain name site:syntax.fm

wesbos avatar Aug 08 '18 14:08 wesbos

@wesbos Do you have specific plans for this? Do you mind if I give it a crack?

tkilgour avatar Aug 30 '18 14:08 tkilgour

Were taking to algolia right now - I’m on vacation so I’m not sure of the status but if you want to give t a crack - go ahead!

On August 30, 2018 at 10:36 AM, Thomas Kilgour ([email protected]) wrote:

@wesbos ( https://github.com/wesbos ) Do you have specific plans for this? Do you mind if I give it a crack? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub ( https://github.com/wesbos/Syntax/issues/120#issuecomment-417342332 )

, or mute the thread ( https://github.com/notifications/unsubscribe-auth/AAKvjX5arGNi-BbkRGcDBvtPs5sTDUD9ks5uV_hQgaJpZM4VzGe7 ) .

wesbos avatar Aug 30 '18 14:08 wesbos

Hey @wesbos!

I built a somewhat functional version of a search bar. Wanted to check to see if you would be interested in integrating it before finishing it off, since it's fairly opinionated.

Features

  • filters the existing sidebar instead of a standalone search component (ie. an autocompleting dropdown)
  • searches both show titles and show notes
  • highlights the query text in show notes

Issues

  • currently matches against show.html for show notes which is raw HTML. Not ideal since it will match tags, and won't match encoded characters
  • styling issues when one or no items are matched
  • a few bugs I'd like to polish with highlighting and the search bar scrolling out of view

Let me know your thoughts. The search field could also be hidden and only revealed when the magnifying glass is clicked, as opposed to persisting at the top of the list.

Happy vacationing! 😎☀️


syntax-search

tkilgour avatar Aug 31 '18 22:08 tkilgour

@tkilgour looks great - is this online anywhere?

wesbos avatar Oct 02 '18 13:10 wesbos

@wesbos Fixed the issues I was having before and submitted a PR.

A few things to note:

  • It's still searching the raw HTML but filters out all HTML tags from searchable text. I thought about trying to search the MD files and then cross reference, but never implemented that. It might be a better way to go.
  • It doesn't match encoded characters.
  • There's a bit of noticeable lag – I tried to optimize a few parts, but I'm sure this can still be improved. It's only going to get more pronounced as the show list grows.

tkilgour avatar Oct 04 '18 16:10 tkilgour

+1 It would be great if there was a way to search through the list of potluck questions before deciding to ask a new one!

aalaap avatar Oct 05 '19 06:10 aalaap

Search completed in v2. 62113c6

Screenshot 2023-07-07 at 3 20 51 PM

Published on https://beta.syntax.fm/

stolinski avatar Jul 07 '23 21:07 stolinski