Require gems in :jekyll_plugins group in a Gemfile in unsafe mode.
Replaces #1658. /cc @imathis
This commit is contained in:
parent
01b11d098e
commit
34de676713
|
@ -17,6 +17,7 @@ module Jekyll
|
||||||
def conscientious_require
|
def conscientious_require
|
||||||
require_plugin_files
|
require_plugin_files
|
||||||
require_gems
|
require_gems
|
||||||
|
require_from_bundler
|
||||||
end
|
end
|
||||||
|
|
||||||
# Require each of the gem plugins specified.
|
# Require each of the gem plugins specified.
|
||||||
|
@ -30,6 +31,15 @@ module Jekyll
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def require_from_bundler
|
||||||
|
unless site.safe
|
||||||
|
require "bundler/setup"
|
||||||
|
Bundler.require(:jekyll_plugins)
|
||||||
|
end
|
||||||
|
rescue LoadError
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
# Check whether a gem plugin is allowed to be used during this build.
|
# Check whether a gem plugin is allowed to be used during this build.
|
||||||
#
|
#
|
||||||
# gem_name - the name of the gem
|
# gem_name - the name of the gem
|
||||||
|
|
Loading…
Reference in New Issue