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.safe = config['safe']
|
||||||
self.source = File.expand_path(config['source'])
|
self.source = File.expand_path(config['source'])
|
||||||
self.dest = File.expand_path(config['destination'])
|
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.lsi = config['lsi']
|
||||||
self.pygments = config['pygments']
|
self.pygments = config['pygments']
|
||||||
self.permalink_style = config['permalink'].to_sym
|
self.permalink_style = config['permalink'].to_sym
|
||||||
|
@ -72,10 +78,12 @@ module Jekyll
|
||||||
# If safe mode is off, load in any Ruby files under the plugins
|
# If safe mode is off, load in any Ruby files under the plugins
|
||||||
# directory.
|
# directory.
|
||||||
unless self.safe
|
unless self.safe
|
||||||
Dir[File.join(self.plugins, "**/*.rb")].each do |f|
|
self.plugins.each do |plugins|
|
||||||
|
Dir[File.join(plugins, "**/*.rb")].each do |f|
|
||||||
require f
|
require f
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
self.converters = Jekyll::Converter.subclasses.select do |c|
|
self.converters = Jekyll::Converter.subclasses.select do |c|
|
||||||
!self.safe || c.safe
|
!self.safe || c.safe
|
||||||
|
|
Loading…
Reference in New Issue