lib/middleman-webp/extension.rb in middleman-webp-0.1.0 vs lib/middleman-webp/extension.rb in middleman-webp-0.2.0
- old
+ new
@@ -1,14 +1,17 @@
require "middleman-core"
require "middleman-webp/converter"
module Middleman
class WebPExtension < Extension
- def initialize(app, options, &block)
+ option :conversion_options, {}, "Custom conversion options for cwebp/gif2webp"
+
+ def initialize(app, options_hash={}, &block)
super
+ args = options.conversion_options
app.after_build do |builder|
- Middleman::WebP::Converter.new(app, builder).convert
+ Middleman::WebP::Converter.new(app, args, builder).convert
end
end
end
end