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
|
||||
class ExtraImageGenerator < Jekyll::Generator
|
||||
include Jekyll::ResponsiveImage::Utils
|
||||
include FileTest
|
||||
|
||||
def generate(site)
|
||||
config = Config.new(site).to_h
|
||||
|
@ -9,6 +10,7 @@ module Jekyll
|
|||
|
||||
config['extra_images'].each do |pathspec|
|
||||
Dir.glob(site.in_source_dir(pathspec)) do |image_path|
|
||||
if FileTest.file?(image_path)
|
||||
path = Pathname.new(image_path)
|
||||
relative_image_path = path.relative_path_from(site_source)
|
||||
|
||||
|
@ -19,4 +21,5 @@ module Jekyll
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue