Merge pull request #1656 from mojombo/plugin-gems-docs
Add docs for new 'gems' option.
This commit is contained in:
commit
2d7a4c69ec
|
@ -281,6 +281,7 @@ layouts: ./_layouts
|
||||||
include: ['.htaccess']
|
include: ['.htaccess']
|
||||||
exclude: []
|
exclude: []
|
||||||
keep_files: ['.git','.svn']
|
keep_files: ['.git','.svn']
|
||||||
|
gems: []
|
||||||
timezone: nil
|
timezone: nil
|
||||||
encoding: nil
|
encoding: nil
|
||||||
|
|
||||||
|
|
|
@ -25,9 +25,27 @@ having to modify the Jekyll source itself.
|
||||||
|
|
||||||
## Installing a plugin
|
## Installing a plugin
|
||||||
|
|
||||||
In your site source root, make a `_plugins` directory. Place your plugins here.
|
You have 2 options for installing plugins:
|
||||||
Any file ending in `*.rb` inside this directory will be loaded before Jekyll
|
|
||||||
generates your site.
|
1. In your site source root, make a `_plugins` directory. Place your plugins here.
|
||||||
|
Any file ending in `*.rb` inside this directory will be loaded before Jekyll
|
||||||
|
generates your site.
|
||||||
|
2. In your `_config.yml` file, add a new array with the key `gems` and the values
|
||||||
|
of the gem names of the plugins you'd like to use. An example:
|
||||||
|
|
||||||
|
gems: [jekyll-test-plugin, jekyll-jsonify, jekyll-assets]
|
||||||
|
# This will require each of these gems automatically.
|
||||||
|
|
||||||
|
<div class="note info">
|
||||||
|
<h5>
|
||||||
|
<code>_plugins</code> and <code>gems</code>
|
||||||
|
can be used simultaneously
|
||||||
|
</h5>
|
||||||
|
<p>
|
||||||
|
You may use both of the aforementioned plugin options simultaneously in the
|
||||||
|
same site if you so choose. Use of one does not restrict the use of the other
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
In general, plugins you make will fall into one of three categories:
|
In general, plugins you make will fall into one of three categories:
|
||||||
|
|
||||||
|
@ -67,7 +85,7 @@ module Reading
|
||||||
class Generator < Jekyll::Generator
|
class Generator < Jekyll::Generator
|
||||||
def generate(site)
|
def generate(site)
|
||||||
ongoing, done = Book.all.partition(&:ongoing?)
|
ongoing, done = Book.all.partition(&:ongoing?)
|
||||||
|
|
||||||
reading = site.pages.detect {|page| page.name == 'reading.html'}
|
reading = site.pages.detect {|page| page.name == 'reading.html'}
|
||||||
reading.data['ongoing'] = ongoing
|
reading.data['ongoing'] = ongoing
|
||||||
reading.data['done'] = done
|
reading.data['done'] = done
|
||||||
|
@ -394,7 +412,7 @@ You can find a few useful plugins at the following locations:
|
||||||
|
|
||||||
- [ArchiveGenerator by Ilkka Laukkanen](https://gist.github.com/707909): Uses [this archive page](https://gist.github.com/707020) to generate archives.
|
- [ArchiveGenerator by Ilkka Laukkanen](https://gist.github.com/707909): Uses [this archive page](https://gist.github.com/707020) to generate archives.
|
||||||
- [LESS.js Generator by Andy Fowler](https://gist.github.com/642739): Renders LESS.js files during generation.
|
- [LESS.js Generator by Andy Fowler](https://gist.github.com/642739): Renders LESS.js files during generation.
|
||||||
- [Version Reporter by Blake Smith](https://gist.github.com/449491): Creates a version.html file containing the Jekyll version.
|
- [Version Reporter by Blake Smith](https://gist.github.com/449491): Creates a version.html file containing the Jekyll version.
|
||||||
- [Sitemap.xml Generator by Michael Levin](https://github.com/kinnetica/jekyll-plugins): Generates a sitemap.xml file by traversing all of the available posts and pages.
|
- [Sitemap.xml Generator by Michael Levin](https://github.com/kinnetica/jekyll-plugins): Generates a sitemap.xml file by traversing all of the available posts and pages.
|
||||||
- [Full-text search by Pascal Widdershoven](https://github.com/PascalW/jekyll_indextank): Adds full-text search to your Jekyll site with a plugin and a bit of JavaScript.
|
- [Full-text search by Pascal Widdershoven](https://github.com/PascalW/jekyll_indextank): Adds full-text search to your Jekyll site with a plugin and a bit of JavaScript.
|
||||||
- [AliasGenerator by Thomas Mango](https://github.com/tsmango/jekyll_alias_generator): Generates redirect pages for posts when an alias is specified in the YAML Front Matter.
|
- [AliasGenerator by Thomas Mango](https://github.com/tsmango/jekyll_alias_generator): Generates redirect pages for posts when an alias is specified in the YAML Front Matter.
|
||||||
|
|
Loading…
Reference in New Issue