Permalink
Browse files

Support plugins being a list of directories to scan.

  • Loading branch information...
1 parent 9fbf90c commit ab08acace956ce834e474369967bc08650e6c6a4 @simensen simensen committed Nov 22, 2011
Showing with 11 additions and 3 deletions.
  1. +11 −3 lib/jekyll/site.rb
View
@@ -18,7 +18,13 @@ def initialize(config)
self.safe = config['safe']
self.source = File.expand_path(config['source'])
self.dest = File.expand_path(config['destination'])
- self.plugins = File.expand_path(config['plugins'])
+ self.plugins = if config['plugins'].respond_to?('each')
+ # If plugins is an array, process it.
+ config['plugins'].each { |directory| File.expand_path(directory) }
+ else
+ # Otherwise process a single entry as an array.
+ [File.expand_path(config['plugins'])]
+ end
self.lsi = config['lsi']
self.pygments = config['pygments']
self.permalink_style = config['permalink'].to_sym
@@ -72,8 +78,10 @@ def setup
# If safe mode is off, load in any Ruby files under the plugins
# directory.
unless self.safe
- Dir[File.join(self.plugins, "**/*.rb")].each do |f|
- require f
+ self.plugins.each do |plugins|
+ Dir[File.join(plugins, "**/*.rb")].each do |f|
+ require f
+ end
end
end

0 comments on commit ab08aca

Please sign in to comment.