jekyll-image-size
jekyll-image-size copied to clipboard
Liquid Exception: undefined method `sub'
Hi!
crashes with Jekyll 4.0.0 on ruby 2.6.5p114 (arch linux):
Jekyll::Drops::StaticFileDrop Liquid Exception: undefined method `sub' for #<Jekyll::Drops::StaticFileDrop:0x00005587c47f6fd8> in index.html
Works using this small patch:
diff --git a/lib/jekyll-image-size.rb b/lib/jekyll-image-size.rb
index ead00a0..560c911 100644
--- a/lib/jekyll-image-size.rb
+++ b/lib/jekyll-image-size.rb
@@ -32,7 +32,7 @@ class ImageSizeTag < Liquid::Tag
size = FastImage.size(source)
if context && !size
if contextSource = rawSource = context[source]
- contextSource = contextSource.sub(/^\//, '')
+ contextSource = contextSource.path.sub(/^\//, '')
size = FastImage.size(contextSource)
end
end
(END)
But this crashes for older versions (#2)
Unfortunately don't really know ruby well so can't tell more...