diff --git a/README.md b/README.md index 5641f04..456ee33 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,7 @@ # Algolia Jekyll Plugin Jekyll plugin to automatically index your Jekyll posts and pages into an -Algolia index. - -## Usage - -```shell -$ jekyll algolia push -``` - -This will push the content of your jekyll website to your Algolia index. +Algolia index by simply running `jekyll algolia push`. ## Installation @@ -57,19 +49,29 @@ or the `./_algolia_api_key` file. Note that if you decide to use the `./_algolia_api_key` approach, we strongly encourage you to not track this file in your versionning system. +## Usage + +```shell +$ jekyll algolia push +``` + +This will push the content of your jekyll website to your Algolia index. + +You can specify any option you would normally pass to `jekyll build`, like +`--config`, `--source`, `--destination`, etc. + +## Searching + +This plugin will only index your data in your Algolia index. Adding search +capabilities is quite easy. You can follow [our tutorials][1] or use our forked +version of the [Hyde theme][2]. ## GitHub Pages Unfortunatly, GitHub does not allow custom plugins to be run on GitHub Pages. -This means that you will have to manually run `jekyll algolia push` before +This mean that you will have to manually run `jekyll algolia push` before pushing your content to GitHub. -## Search - -Now that your index is populated with your data, you can start searching in it. -You can query it yourself using our [Javascript client][1], or you can use -our updated [Hyde theme][2]. - [1]: https://www.algolia.com/doc/javascript [2]: https://github.com/algolia/algoliasearch-jekyll-hyde diff --git a/algoliasearch-jekyll.gemspec b/algoliasearch-jekyll.gemspec index ee421f1..bae2575 100644 --- a/algoliasearch-jekyll.gemspec +++ b/algoliasearch-jekyll.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'algoliasearch-jekyll' - s.version = '0.1.0' + s.version = '0.1.1' s.date = '2015-06-18' s.summary = 'AlgoliaSearch for Jekyll' s.description = 'Index all your pages and posts to an Algolia index with `jekyll algolia index`' diff --git a/lib/algoliasearch-jekyll.rb b/lib/algoliasearch-jekyll.rb index 834f1d4..bb7142e 100644 --- a/lib/algoliasearch-jekyll.rb +++ b/lib/algoliasearch-jekyll.rb @@ -14,7 +14,7 @@ class AlgoliaSearchJekyll < Jekyll::Command command.description 'Keep your content in sync with your Algolia index' command.command(:push) do |subcommand| - subcommand.syntax 'push [INDEX_NAME] [options]' + subcommand.syntax 'push [options]' subcommand.description 'Push your content to your index' add_build_options(subcommand) @@ -31,13 +31,13 @@ class AlgoliaSearchJekyll < Jekyll::Command def add_build_options(command) command.option 'config', '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file' - command.option 'future', '--future', 'Publishes posts with a future date' + command.option 'future', '--future', 'Index posts with a future date' command.option 'limit_posts', '--limit_posts MAX_POSTS', Integer, - 'Limits the number of posts to parse and publish' + 'Limits the number of posts to parse and index' command.option 'show_drafts', '-D', '--drafts', - 'Render posts in the _drafts folder' + 'Index posts in the _drafts folder' command.option 'unpublished', '--unpublished', - 'Render posts that were marked as unpublished' + 'Index posts that were marked as unpublished' end def api_key diff --git a/lib/push.rb b/lib/push.rb index 69882d4..64cd01d 100644 --- a/lib/push.rb +++ b/lib/push.rb @@ -43,7 +43,8 @@ class AlgoliaSearchJekyllPush < Jekyll::Command Jekyll.logger.error 'Algolia Error: No API key defined' Jekyll.logger.warn ' You have two ways to configure your API key:' Jekyll.logger.warn ' - The ALGOLIA_API_KEY environment variable' - Jekyll.logger.warn ' - A file named ./_algolia_api_key' + Jekyll.logger.warn ' - A file named ./_algolia_api_key in your '\ + 'source folder' exit 1 end @@ -114,7 +115,8 @@ class AlgoliaSearchJekyllPush < Jekyll::Command end end - Jekyll.logger.info "Indexing of #{items.size} items done." + Jekyll.logger.info "Indexing of #{items.size} items " \ + "in #{index_name} done." end def get_items_from_file(file)