Skip to content

Commit ab08aca

Browse files
committed
Support plugins being a list of directories to scan.
1 parent 9fbf90c commit ab08aca

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

lib/jekyll/site.rb

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ def initialize(config)
1818
self.safe = config['safe']
1919
self.source = File.expand_path(config['source'])
2020
self.dest = File.expand_path(config['destination'])
21-
self.plugins = File.expand_path(config['plugins'])
21+
self.plugins = if config['plugins'].respond_to?('each')
22+
# If plugins is an array, process it.
23+
config['plugins'].each { |directory| File.expand_path(directory) }
24+
else
25+
# Otherwise process a single entry as an array.
26+
[File.expand_path(config['plugins'])]
27+
end
2228
self.lsi = config['lsi']
2329
self.pygments = config['pygments']
2430
self.permalink_style = config['permalink'].to_sym
@@ -72,8 +78,10 @@ def setup
7278
# If safe mode is off, load in any Ruby files under the plugins
7379
# directory.
7480
unless self.safe
75-
Dir[File.join(self.plugins, "**/*.rb")].each do |f|
76-
require f
81+
self.plugins.each do |plugins|
82+
Dir[File.join(plugins, "**/*.rb")].each do |f|
83+
require f
84+
end
7785
end
7886
end
7987

0 commit comments

Comments
 (0)