lib/middleman-simple-thumbnailer/extension.rb in middleman-simple-thumbnailer-0.0.7 vs lib/middleman-simple-thumbnailer/extension.rb in middleman-simple-thumbnailer-1.0.0
- old
+ new
@@ -6,17 +6,23 @@
# = image_tag item.image, resize_to: '50x30', class: 'thumbnail'
#
module MiddlemanSimpleThumbnailer
class Extension < Middleman::Extension
+ option :cache_dir, 'tmp/simple-thumbnailer-cache', 'Directory (relative to project root) for cached thumbnails.'
+
def initialize(app, options_hash={}, &block)
super
app.after_build do |builder|
MiddlemanSimpleThumbnailer::Image.all_objects.each do |image|
builder.say_status :create, "#{image.resized_img_path}"
image.save!
end
end
+ end
+
+ def after_configuration
+ MiddlemanSimpleThumbnailer::Image.options = options
end
helpers do
def image_tag(path, options={})
\ No newline at end of file