jekyll-algolia is a Jekyll plugin that lets you push all your content in an
You need to add
jekyll-algolia to your
Gemfile, as part of the
:jekyll-plugins group. If you do not yet have a Gemfile, here is the minimal
content you’ll need:
source 'https://rubygems.org' gem 'jekyll', '~> 3.6' group :jekyll_plugins do gem 'jekyll-algolia' end
bundle install to update your dependencies.
If everything went well, you should be able to run
jekyll help and see the
algolia subcommand listed.
You need to provide your Algolia credentials for this plugin to index your site.
Once you have your credentials, you should define your
index_name inside your
_config.yml file like this:
# _config.yml algolia application_idyour_application_id index_namejekyll # You can replace that with whatever name you want
Once your credentials are setup, you can run the indexing by running the following command:
ALGOLIA_API_KEY='your_admin_api_key' bundle exec jekyll algolia
ALGOLIA_API_KEY should be set to your admin API key. This key has
write access to your index so will be able to push new data. This is also why
you have to set it on the command line and not in the
_config.yml file: you
want to keep this key secret and not commit it to your versioning system.
The plugin only takes care of extracting your data and pushing it to an Algolia index. Building the front-end that will allow your users to search into that data is not part of the plugin.
As it would depend too much on the theme you applied to Jekyll, we could not create a one-size-fits-all solution. Instead, the best solution is to use our InstantSearch.js library (also available for Vue.js, React and Angular). It’s an easy-to-use set of UI widgets you can use to build your own search in a matter of minutes.
You can follow this tutorial to see how to add search on the default blog theme.