Giter Club home page Giter Club logo

jekyll_indextank's Introduction

Jekyll + indextank = Static websites with powerful full-text search

How to use:

  • Place jekyll_indextank.rb inside the _plugins folder in the root of your jekyll site.
  • Add 'indextank_index', 'indextank_api_url' and optionally 'indextank_excludes' settings to your _config.yml

All pages' main content will be indexed at indextank, now all you have to do is hook up some Javascript and ajax to a form to query the indextank api.
Note that, while at the time of writing, the indextank api docs do not show that the search api supports jsonp, it does. Just add &callback=mycallback to the api call.

How it works

Everytime you generate your Jekyll site, all pages will be indexed at IndexTank. Now when you query the IndexTank search api, something like this will be returned:

{"matches": 1, "facets": {}, "search_time": "0.002", "results": [{"docid": "/blog/2009/01/04/colored-uiprogressview.html"}]}

The "docid" field contains the absolute url (minus domain name) to the matched resource.

JavaScript usage example

$.getJSON("http://<your_api_key>.api.indextank.com/v1/indexes/<your_index>/search?q=<a query>&callback=?", function(json) {
	alert(json.results); //you might want to approve usability a bit ;-)
});

See examples/example.html for a basic example, showing results in a div.

For a live example see the search on my blog http://pwiddershoven.nl

Requirements

Jekyll_indextank requires the following gems:

  • indextank
  • nokogiri

For an example of available config settings, see example_config.yml.

Installation

  • gem install indextank nokogiri
  • rake build
  • copy build/jekyll_indextank.rb to your hyde site's _plugins folder

jekyll_indextank's People

Contributors

francois2metz avatar

Watchers

Kostas Georgiadis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.