Support plugins being a list of directories to scan.
This commit is contained in:
parent
9fbf90ce59
commit
ab08acace9
|
@ -18,7 +18,13 @@ module Jekyll
|
|||
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 @@ module Jekyll
|
|||
# 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
|
||||
|
||||
|
|
Loading…
Reference in New Issue