forked from cockroachdb/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Peter Panagiotakos
committed
Feb 26, 2020
1 parent
2c22e1c
commit 7196cd4
Showing
39 changed files
with
2,826 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
Hi collaborator! | ||
|
||
If you have a fix or a new feature, please start by checking in the [issues][1] | ||
if it is already referenced. If not, feel free to open one. | ||
|
||
We use [pull requests][2] | ||
for collaboration. The workflow is as follow: | ||
|
||
- Create a local branch, starting from `develop` | ||
- Submit the PR on `develop` | ||
- Wait for review | ||
- Do the changes requested (if any) | ||
- We may ask you to rebase the branch to latest `develop` if it gets out of sync | ||
- Receive the thanks of the Algolia team :) | ||
|
||
# Development workflow | ||
|
||
Start by running `bundle install` to get all the dependencies up to date. | ||
|
||
## Testing | ||
|
||
Run `rake test` to launch the test suite. Run `./scripts/test_all_ruby_versions` | ||
to run the test on all the supported ruby versions (requires `rvm`). | ||
|
||
## TDD | ||
|
||
Run `rake watch` to start a watcher on the code and test files. Whenever you | ||
update the code, the relevant tests will be run. Incredibly useful for TDD. | ||
|
||
## Testing local changes on an existing Jekyll website | ||
|
||
If you want to test the plugin on an existing Jekyll website while developping, | ||
we suggest updating the website `Gemfile` to point to the correct local directory | ||
|
||
```ruby | ||
group :jekyll_plugins do | ||
gem "jekyll-algolia", :path => "/path/to/local/gem/folder" | ||
end | ||
``` | ||
|
||
## Running integration tests | ||
|
||
Integration tests will do a full jekyll run, and push data to an Algolia index, | ||
checking that records and settings are correctly saved. It is the slowest | ||
possible kind of tests, but also the one closest to a real implementation. | ||
|
||
Running those tests requires a real Algolia plan. You need to define | ||
`ALGOLIA_APPLICATION_ID`, `ALGOLIA_API_KEY` and `ALGOLIA_INDEX_NAME` (we suggest | ||
using `direnv` for that), and then run `./scripts/test_integration`. | ||
|
||
## Linting | ||
|
||
Run `rake lint` to check the style of all ruby files. Run `rake | ||
lint:auto_correct` to try to automatically correct the potential violations. | ||
It's always a good practice to double check the modification after an | ||
auto-correct. | ||
|
||
# Git Hooks | ||
|
||
If you plan on submitting a PR, we suggest you install the git hooks located in | ||
`./scripts/git_hook`. Those hooks will run the linter on each commit, and the | ||
tests before each push. This greatly help reduce the chances of breaking the | ||
build on Travis. | ||
|
||
The easiest way is to create a symlink from your `.git/hooks` folder: | ||
|
||
```sh | ||
$ git root | ||
$ rm ./.git/hooks | ||
$ ln -s ./scripts/git_hooks/ ./.git/hooks | ||
``` | ||
|
||
# Tagging and releasing | ||
|
||
If you need to release a new version of the gem, run `rake release` from the | ||
`develop` branch. It will ask you for the new version and automatically create | ||
the git tags, create the gem and push it to Rubygems. | ||
|
||
# Documentation | ||
|
||
## Requirements | ||
|
||
The documentation website uses Metalsmith (and not Jekyll), so you'll need: | ||
|
||
- Node.js >= v9.2.0, use nvm - [install instructions][3] | ||
- Yarn >= v1.3.2 - [install instructions][4] | ||
|
||
## Development | ||
|
||
All the documentation source files live in the `./docs-src` folder. | ||
|
||
To serve a local version of the documentation (including livereload), run `rake | ||
docs:serve`. The documentation will be available on | ||
[localhost:3000](http://localhost:3000/). | ||
|
||
This will create a `./docs-dev` folder and serve files from there. This folder | ||
is ignored by git. | ||
|
||
## Deploying docs | ||
|
||
To update the documentation website, you should run `rake docs:deploy` from the | ||
`develop` branch. This will merge `develop` into master, build the documentation | ||
into `docs` and push it. The content of the `./docs` folder will then be server | ||
by GitHub pages. | ||
|
||
# Project owner | ||
|
||
[@pixelastic][5] | ||
|
||
|
||
[1]: https://github.com/algolia/jekyll-algolia/issues | ||
[2]: https://github.com/algolia/jekyll-algolia/pulls | ||
[3]: https://github.com/creationix/nvm#install-script | ||
[4]: https://yarnpkg.com/en/docs/install#alternatives-tab | ||
[5]: https://github.com/pixelastic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
# Jekyll Algolia Plugin | ||
|
||
[![gem version][1]][16] | ||
![ruby][2] | ||
![jekyll][3] | ||
[![build master][4]][17] | ||
[![build develop][6]][17] | ||
[![coverage master][5]][18] | ||
|
||
Add fast and relevant search to your Jekyll site. | ||
|
||
## Usage | ||
|
||
```shell | ||
$ bundle exec jekyll algolia | ||
``` | ||
|
||
This will push the content of your Jekyll website to your Algolia index. | ||
|
||
## Documentation | ||
|
||
Full documentation can be found on | ||
[https://community.algolia.com/jekyll-algolia/][20] | ||
|
||
## Installation | ||
|
||
The plugin requires at least Jekyll 3.6.0 and Ruby 2.3.0. | ||
|
||
First, add the `jekyll-algolia` gem to your `Gemfile`, in the `:jekyll_plugins` | ||
section. | ||
|
||
```ruby | ||
# Gemfile | ||
|
||
group :jekyll_plugins do | ||
gem 'jekyll-algolia', '~> 1.0' | ||
end | ||
``` | ||
|
||
Once this is done, download all dependencies with `bundle install`. | ||
|
||
## Basic configuration | ||
|
||
You need to provide certain Algolia credentials for this plugin to _index_ your | ||
site. | ||
|
||
_If you don't yet have an Algolia account, we suggest that you open a free | ||
[Community plan here][8]. You can find more information about the Algolia plans | ||
[in our FAQ][10]._ | ||
|
||
Once signed in, you should get your application ID from [your dashboard][9] and | ||
define it inside your `_config.yml` file like this: | ||
|
||
```yaml | ||
# _config.yml | ||
|
||
algolia: | ||
application_id: 'your_application_id' | ||
``` | ||
## Run it | ||
Once your application ID is setup, you can run the indexing by running the | ||
following command: | ||
```shell | ||
ALGOLIA_API_KEY='your_admin_api_key' bundle exec jekyll algolia | ||
``` | ||
|
||
Note that `ALGOLIA_API_KEY` should be set to your admin API key. | ||
|
||
## More about the Community plan | ||
|
||
The Algolia [Community plan][11] lets you host up to 10k records and perform up | ||
to 100k add/edit/delete operations per month (search operations are free). The | ||
plan is entirely free, with no time limit. | ||
|
||
What we ask in exchange is that you display a "Search by Algolia" logo next to | ||
your search results. Our [InstantSearch libraries][12] have a simple boolean | ||
option to toggle that on an off. If you want more flexibility, you can find | ||
all versions of our logo [here][13]. | ||
|
||
If you need more information about the other Algolia plans, you can [check our | ||
FAQ][10]. | ||
|
||
# Thanks | ||
|
||
Thanks to [Anatoliy Yastreb][14] for a [great tutorial][15] on creating Jekyll | ||
plugins. | ||
|
||
[1]: https://badge.fury.io/rb/jekyll-algolia.svg | ||
|
||
[2]: https://img.shields.io/badge/ruby-%3E%3D%202.3.0-green.svg | ||
|
||
[3]: https://img.shields.io/badge/jekyll-%3E%3D%203.6.0-green.svg | ||
|
||
[4]: https://img.shields.io/badge/dynamic/json.svg?label=build%3Amaster&query=value&uri=https%3A%2F%2Fimg.shields.io%2Ftravis%2Falgolia%2Fjekyll-algolia.json%3Fbranch%3Dmaster | ||
|
||
[5]: https://coveralls.io/repos/github/algolia/jekyll-algolia/badge.svg?branch=master | ||
|
||
[6]: https://img.shields.io/badge/dynamic/json.svg?label=build%3Adevelop&query=value&uri=https%3A%2F%2Fimg.shields.io%2Ftravis%2Falgolia%2Fjekyll-algolia.json%3Fbranch%3Ddevelop | ||
|
||
[7]: https://coveralls.io/repos/github/algolia/jekyll-algolia/badge.svg?branch=develop | ||
|
||
[8]: #more-about-the-community-plan | ||
|
||
[9]: https://www.algolia.com/api-keys | ||
|
||
[10]: https://community.algolia.com/jekyll-algolia/faq.html#how-many-records-will-the-plugin-need | ||
|
||
[11]: https://www.algolia.com/users/sign_up/hacker | ||
|
||
[12]: https://community.algolia.com/instantsearch.js/ | ||
|
||
[13]: https://www.algolia.com/press/?section=brand-guidelines | ||
|
||
[14]: https://github.com/ayastreb/ | ||
|
||
[15]: https://ayastreb.me/writing-a-jekyll-plugin/ | ||
|
||
[16]: https://rubygems.org/gems/jekyll-algolia | ||
|
||
[17]: https://travis-ci.org/algolia/jekyll-algolia | ||
|
||
[18]: https://coveralls.io/github/algolia/jekyll-algolia?branch=master | ||
|
||
[19]: https://coveralls.io/github/algolia/jekyll-algolia?branch=develop | ||
|
||
[20]: https://community.algolia.com/jekyll-algolia/getting-started.html |
Oops, something went wrong.