You have 3 options for installing plugins:
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.
_config.yml file, add a new array with the key
gems for Jekyll <
3.5.0) and the values of the gem names of the plugins you’d like to use. An example:
# This will require each of these plugins automatically. plugins: - jekyll-gist - jekyll-coffeescript - jekyll-assets - another-jekyll-plugin
Then install your plugins using
gem install jekyll-gist jekyll-coffeescript jekyll-assets another-jekyll-plugin
Add the relevant plugins to a Bundler group in your
Gemfile. An example:
group :jekyll_plugins do gem "jekyll-gist" gem "jekyll-coffeescript" gem "jekyll-assets" gem "another-jekyll-plugin" end
Now you need to install all plugins from your Bundler group by running single command
Plugins on GitHub Pages
GitHub Pages is powered by Jekyll. All Pages sites are generated using the
--safeoption to disable plugins (with the exception of some whitelisted plugins) for security reasons. Unfortunately, this means your plugins won’t work if you’re deploying to GitHub Pages.
You can still use GitHub Pages to publish your site, but you’ll need to convert the site locally and push the generated static files to your GitHub repository instead of the Jekyll source files.
Gemfilecan be used simultaneously
You may use any of the aforementioned plugin options simultaneously in the same site if you so choose. Use of one does not restrict the use of the others.
Jekyll gives this particular group of gems in your
Gemfile a different treatment. Any gem included in this group is loaded before Jekyll starts processing the rest of your source directory.
A gem included here will be activated even if its not explicitly listed under the
plugins: key in your site’s config file.
Gems included in the
:jekyll-pluginsgroup are activated regardless of the
--safemode setting. Be aware of which gems are included under this group!
© 2020 Jekyll Core Team and contributors
Licensed under the MIT license.