Add condition to extra image generation to only operate on 'files' returned by the glob
This commit is contained in:
parent
311f434ed7
commit
aaaabbc2c0
|
@ -2,6 +2,7 @@ module Jekyll
|
||||||
module ResponsiveImage
|
module ResponsiveImage
|
||||||
class ExtraImageGenerator < Jekyll::Generator
|
class ExtraImageGenerator < Jekyll::Generator
|
||||||
include Jekyll::ResponsiveImage::Utils
|
include Jekyll::ResponsiveImage::Utils
|
||||||
|
include FileTest
|
||||||
|
|
||||||
def generate(site)
|
def generate(site)
|
||||||
config = Config.new(site).to_h
|
config = Config.new(site).to_h
|
||||||
|
@ -9,6 +10,7 @@ module Jekyll
|
||||||
|
|
||||||
config['extra_images'].each do |pathspec|
|
config['extra_images'].each do |pathspec|
|
||||||
Dir.glob(site.in_source_dir(pathspec)) do |image_path|
|
Dir.glob(site.in_source_dir(pathspec)) do |image_path|
|
||||||
|
if FileTest.file?(image_path)
|
||||||
path = Pathname.new(image_path)
|
path = Pathname.new(image_path)
|
||||||
relative_image_path = path.relative_path_from(site_source)
|
relative_image_path = path.relative_path_from(site_source)
|
||||||
|
|
||||||
|
@ -20,3 +22,4 @@ module Jekyll
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue