Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add dev docs #212

Merged
merged 9 commits into from
Jan 27, 2022
11 changes: 7 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,24 @@ Jekyll plugin to propagate the `site.github` namespace and set default values fo

## Usage

Usage of this gem is pretty straight-forward. Add it to your bundle like this:
Usage of this gem is pretty straight-forward. Add it to your `Gemfile` like this:

```ruby
gem "jekyll-github-metadata"
```

Now add it to your `_config.yml`:
Add it to your `_config.yml`:

```yaml
plugins:
- "jekyll-github-metadata"
```

:warning: If you are using Jekyll < 3.5.0 use the `gems` key instead of `plugins`.
:warning: If you are using Jekyll < 3.5.0, use the `gems` key instead of `plugins`.

Then go ahead and run `bundle install`. Once you've done that jekyll-github-metadata will run when you run Jekyll.
Then go ahead and run `bundle install`.

Now, whenever you build or serve with Jekyll, the `jekyll-github-metadata` plugin will run.


## Further reading
Expand All @@ -43,3 +45,4 @@ Then go ahead and run `bundle install`. Once you've done that jekyll-github-meta
* [Configuration](configuration.md)
* [Using `site.github`](site.github.md)
* [Edit on GitHub link](edit-on-github-link.md)
* [Development](development.md)
121 changes: 121 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
## Development
> Guide to local development of this plugin

### Installation

#### Requirements

- Ruby
- Bundler

#### Install system dependencies

- Install Ruby - see the [Downloads](https://www.ruby-lang.org/en/downloads/) page.
- Install Bundler - see [Bundler](https://bundler.io/) homepage.

#### Clone

Clone the repo, or your fork.

```bash
$ git clone [email protected]:jekyll/github-metadata.git
$ cd github-metadata
```

#### Install project dependencies

Configure Bundler.

```bash
$ bundle config set --local path vendor/bundle
```

Install gems.

```bash
$ bundle install
```

Or, for a faster install.

```bash
$ script/bootstrap
```

### Usage

See the [script](/script/) directory.

#### Format

Check for code formatting issues - recommended before you commit.

```bash
$ script/fmt
```

Fix formatting issues.

```bash
$ script/fmt -a
```

#### Open interactive console

```bash
$ script/console
```

#### Test

Run all unit tests.

```bash
$ script/test
```

Run a target unit test file by specifying a path.

```bash
$ script/test spec/owner_spec.rb
```

See some recommended flags below.

Run tests in the order they are written (not a random order).

```bash
$ script/test --order defined
```

Run tests in the same random order as a previous run.

```bash
$ script/test --seed 12345
```

Run tests with verbose trace logs.

```bash
$ script/test --format documentation
```

#### Start dev server

Preview the plugin in Jekyll by running the repo's sample Jekyll site.

```bash
$ script/test-site
```

Then open in the browser at:

- http://127.0.0.1:4000

### Release

Run tests, formatting and create a release.

```bash
$ script/release
```