https://github.com/pascalw/jekyll_indextank
Jekyll + indextank = Static websites with powerful full-text search
https://github.com/pascalw/jekyll_indextank
Last synced: 11 months ago
JSON representation
Jekyll + indextank = Static websites with powerful full-text search
- Host: GitHub
- URL: https://github.com/pascalw/jekyll_indextank
- Owner: pascalw
- Created: 2011-05-11T06:36:28.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2016-02-13T18:18:23.000Z (over 10 years ago)
- Last Synced: 2025-03-24T04:13:10.429Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 8.79 KB
- Stars: 177
- Watchers: 8
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.mdown
Awesome Lists containing this project
README
## 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](http://indextank.com/documentation/api#searching).
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://.api.indextank.com/v1/indexes//search?q=&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
### 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