After migrating my blog from Wordpress to Jekyll, one thing I was missing was a functional search box. I threw one together last night.

The first problem is getting a “database” of blog posts that can be searched with jQuery. Luckily Jekyll parses anything with YAML Front Matter, so I was able to whip up a posts.json file that’s dynamically created.

Next, I tried using Ziadin Givan’s jQuery autocomplete plugin but it didn’t quite work the way I needed it to. I ended up using it as a starting point to roll my own.

A sample gist is up to get you going, or see the full source.