- Shows how to implement client-side search with no need for SSR or other frontend frameworks
- Uses browser APIs in a script tag to handle user input and fetch updated results
- Uses a static json endpoint to provide the data
- Uses fuse.js for its fuzzy searching capabilities
- How to choose between fuse and algolia docsearch?
Original video by Coding in Public:
Join the early access list for my course! https://learnastro.dev
Learn how to add fuzzy searching to an SSG Astro site using FuseJS and client-size JavaScript.
In this series, we’ll cover:
- Lesson 1: Intro and Setup
- Lesson 2: Add a Search Widget
- Lesson 3: Sanitize and Redirect Input
- Lesson 4: Create a Search Route
- Lesson 5: Generate JSON Search Endpoint
- Lesson 6: Fetch Data on Search
- Lesson 7: Add FuseJS Fuzzy Search
- Lesson 8: Show Search Results
🔗 Key Links 🔗
- Github: https://github.com/coding-in-public/astro-search-fusejs/tree/main
- Demo: https://codinginpublic.dev/projects/astro-search-fusejs/
- YouTube Playlist: https://www.youtube.com/playlist?list=PLoqZcxvpWzzdlyJMZOGB5aYt8ImxzRxYs
---------------------------------------
⏲️ Timestamps ⏲️
0:00 Intro and Setup
6:24 Add a Search Widget
12:38 Sanitize and Redirect Input
18:56 Create a Search Route
27:33 Generate JSON Search Endpoint
32:11 Fetch Data on Search
38:21 Add FuseJS Fuzzy Search
44:01 Show Search Results
---------------------------------------
🎨 VSCode Theming
- Font: Cascadia Code: https://github.com/microsoft/cascadia-code
- Theme: https://marketplace.visualstudio.com/items?itemName=Equinusocio.vsc-community-material-theme
- Icons: https://marketplace.visualstudio.com/items?itemName=BeardedBear.beardedicons
---------------------------------------
🌐 Connect With Me 🌐
- Website: https://codinginpublic.dev
- Blog: https://chrispennington.blog
- Twitter: https://twitter.com/cpenned
- Patreon: https://www.patreon.com/coding\_in\_public
- Buy Me a Coffee: https://www.buymeacoffee.com/chrispennington