An open API service indexing awesome lists of open source software.

https://github.com/vrongmeal/jekyll-github

Jekyll plugin for Github
https://github.com/vrongmeal/jekyll-github

github jekyll jekyll-plugin

Last synced: about 2 months ago
JSON representation

Jekyll plugin for Github

Awesome Lists containing this project

README

          

# jekyll-github

Jekyll plugin for Github

[![Gem Version](https://badge.fury.io/rb/jekyll-github.svg)](https://badge.fury.io/rb/jekyll-github)

## Installing

1. Add `jekyll-github` to your Gemfile:
```
gem 'jekyll-github'
```

2. Add the following to your site's `_config.yml`:
```yml
plugins:
- jekyll-github
```

## How to use it?

* You can add github links simply by adding the string `gh@`.

* You can add the following in your markdown:
* **mention:** `gh@vrongmeal`

This gives the result [@vrongmeal](https://github.com/vrongmeal)

* **repository:** `gh@vrongmeal/readit`
* **repository at a branch:** `gh@vrongmeal/dayts:gh-pages`
* **issue or a pull request:** `gh@vrongmeal/dayts#2`
* **file or directory:** `gh@vrongmeal/dayts/src/index.js`
* **file or directory at a branch:** `gh@vrongmeal/dayts:gh-pages/bundle.js`
* **tag (releases):** `gh@vrongmeal/zulip=1.8.1`

* As you might see, there are certain components in every command type. The following are all the components:
* `user` as in mention
* `repo` as in repository
* `branch` as in repository at a branch
* `issue_pr` in issue or pull request
* `file` path of file or file at a branch
* `tag` as in tag (releases)
* `link` for github link (valid for all)

Let's configure the plugin.

## Configuration

You can configure the plugin either globally (in `_config.yml`) or in particular page (at the top of page between the two `---`). The settings in the page will take preference.

The configuration is for defining the format string for the output of commands. Let's see through an example:

```yml
jekyll-github:
mention: '@'
repo: '/'
repo_branch: '/:'
issue_pr: '#'
file: '/'
file_branch: ':/'
tag: '='
```

This above is the default configuration of the plugin. Let's cutomize it by saying we need complete link for a github file on a page. Simply, we can add the following setting on the top of the page:

```yml
jekyll-github:
file: ''
```

## Summary

| Link to | Setting key | Markdown syntax |
| --- | --- | --- |
| mention | `mention` | `gh@` |
| repository | `repo` | `gh@/` |
| repository at a branch | `repo_branch` | `gh@/:` |
| issue or a pull request | `issue_pr` | `gh@/#` |
| file | `file` | `gh@//` |
| file at a branch | `file_branch` | `gh@/:/` |
| tag (releases) | `tag` | `gh@/=` |

And now you have the power of github in your jekyll site!