Fetching/determining the plugin path is beyond this it's kind of sad.
This commit is contained in:
parent
5d761a1c2b
commit
4a4c8846f4
|
@ -55,7 +55,7 @@ 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 site.safe
|
unless site.safe
|
||||||
plugins.each do |plugins|
|
site.plugins.each do |plugins|
|
||||||
Dir[File.join(plugins, "**", "*.rb")].sort.each do |f|
|
Dir[File.join(plugins, "**", "*.rb")].sort.each do |f|
|
||||||
require f
|
require f
|
||||||
end
|
end
|
||||||
|
@ -63,17 +63,5 @@ module Jekyll
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Static: Setup the plugin search path
|
|
||||||
#
|
|
||||||
# path_from_site - the plugin path from the Site configuration
|
|
||||||
#
|
|
||||||
# Returns an Array of plugin search paths
|
|
||||||
def self.plugins_path(path_from_site)
|
|
||||||
if (path_from_site == Jekyll::Configuration::DEFAULTS['plugins'])
|
|
||||||
[File.join(source, path_from_site)]
|
|
||||||
else
|
|
||||||
Array(path_from_site).map { |d| File.expand_path(d) }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -19,7 +19,7 @@ module Jekyll
|
||||||
|
|
||||||
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 = Jekyll::PluginManager.plugins_path(config['plugins'])
|
self.plugins = plugins_path(config['plugins'])
|
||||||
self.permalink_style = config['permalink'].to_sym
|
self.permalink_style = config['permalink'].to_sym
|
||||||
|
|
||||||
self.file_read_opts = {}
|
self.file_read_opts = {}
|
||||||
|
@ -80,6 +80,19 @@ module Jekyll
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Public: Setup the plugin search path
|
||||||
|
#
|
||||||
|
# path_from_site - the plugin path from the Site configuration
|
||||||
|
#
|
||||||
|
# Returns an Array of plugin search paths
|
||||||
|
def plugins_path(path_from_site)
|
||||||
|
if (path_from_site == Jekyll::Configuration::DEFAULTS['plugins'])
|
||||||
|
[Jekyll.sanitized_path(source, path_from_site)]
|
||||||
|
else
|
||||||
|
Array(path_from_site).map { |d| File.expand_path(d) }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Read Site data from disk and load it into internal data structures.
|
# Read Site data from disk and load it into internal data structures.
|
||||||
#
|
#
|
||||||
# Returns nothing.
|
# Returns nothing.
|
||||||
|
|
Loading…
Reference in New Issue