Octopress with multiple plugin directories

A common complaint out on the Internets about Octopress is that you have to put all your third party plugins into the plugins/ directory in your Octopress repo, which many people find rather annoying because often those plugins have their own git repos you might want to track.

It turns out, though, that there’s a way now that you can load Octopress plugins from multiple directories. The jekyll gem installed by bundler by default doesn’t have this feature yet, but if you install the one from github it works. This is what I did.

First, I changed the jekyll entry in the Gemfile, adding the URL to the git repository:

  gem 'jekyll', '~> 0.11.2', :git => "git://github.com/mojombo/jekyll.git"

Remember to run “bundle install” after making the change.

Then in _config.yml, you make plugins an Array. Instead of just having this:

  plugins: plugins

It looks like this. In this example, I placed the image popup and category list plugins under addon-plugins/, but you should be able to put them anywhere.

  plugins: [ plugins, addon-plugins/octopress-image-popup/plugins, addon-plugins/category_list/plugins ]

With those small changes, you can now have your third party Octopress plugins in multiple locations for easier management. Success!

comments powered by Disqus