Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add a site search feature to a Jekyll Blog?

Tags:

I am looking into migrating my site from Wordpress to Jekyll and would like to maintain the ability to have full-text search for the site. The Wordpress search was fast, reliable, and nicely formatted to match the theme, and I haven't found a decent replacement.

There's a plugin solution that uses indextank, but I am not interested in tying my search through a commercial API with users ranking the search items, I just want something comparable to Wordpress search.

I've also looked into the google Ajax api, but I don't want a floating ajax search box on the site.

There's always google's search for the website, but I haven't found this to be as reliable. (I haven't tried this since I moved to wordpress a few years ago, so perhaps I'm mistaken).

Since all posts are available in plain-text, it seems like it should not be to difficult to create an index for searching them when the site is built, but I have not found a good solution. Any suggestions or examples?

like image 534
cboettig Avatar asked Apr 12 '12 20:04

cboettig


People also ask

Is Jekyll good for blog?

It's fast. Because of the fact that Jekyll doesn't use databases as all the posts that you write in Jekyll are plain markdown files, makes it blazing fast. Apart from this, it has an edge over platforms like WordPress as it doesn't have a backend.


2 Answers

Jekyll + lunr.js = powerful full-text search, using JavaScript in your browser, for your Jekyll static website

like image 120
Ben Smith Avatar answered Sep 17 '22 13:09

Ben Smith


One option to investigate Google Custom Search.

You mention trying to use Google in the past, but I'm not sure if you mean the custom search box as described here. Posting this in case it helps.

like image 34
Alan W. Smith Avatar answered Sep 19 '22 13:09

Alan W. Smith