jekyll full-text search without jQuery or plugin
I did a quick search for full-text search solutions for jekyll (or any static websites). A notable fews have come up in search result:
-
index_tank
lunr-js-search
A quick look at the plugin’s dependency, I give up right away even though I only need that on search page. For the very same reason I opted for jekyll - a static site generator, I want my site to load as fast as possible. Adding a bunch of dependencies like that is against the purpose. I rather go for DuckDuckGo as I’m currently doing.
Dependencies for the jQuery plugin are as follows.
- jQuery
- lunr.js
- Mustache.js
- date.format.js
- URI.js
index_tank
Too bad the service is no longer available.
tapir
The most decent service I found so far. You sign up, add your feed URL so that the service can start indexing your website, add jQuery and tapir.js
and you’re good to go.
Search API:
api/1/search.json?token=******&query=*****
/api/1/search.json?token=******&query=*****&callback=myCallback
tapir.js
looks like a pretty short and simple js file. Adding jQuery dependency on it, is totally overkill.
Exercise for next week: I’m going to replace DuckDuckGo search with Tapir’s search in a few days once I’m done converting Tapir’s jQuery plugin to a pure js solution.