Class: Jekyll::JekyllImageOptimizer
- Inherits:
-
Generator
- Object
- Generator
- Jekyll::JekyllImageOptimizer
- Defined in:
- lib/jekyll/image_optimizer.rb
Instance Method Summary collapse
- #generate(site) ⇒ Object
-
#initialize(config) ⇒ JekyllImageOptimizer
constructor
A new instance of JekyllImageOptimizer.
Constructor Details
#initialize(config) ⇒ JekyllImageOptimizer
Returns a new instance of JekyllImageOptimizer.
19 20 21 22 23 24 25 |
# File 'lib/jekyll/image_optimizer.rb', line 19 def initialize(config) @raw=config['raw_images'] || 'img/raw' @opt=opt_dir(config) @symlink=config['images_link'] || 'images' @geometry=config['image_geometry'] || '800x800>' @hash=use_hash(config) end |
Instance Method Details
#generate(site) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/jekyll/image_optimizer.rb', line 27 def generate(site) io=ImageOptimizer.new(@raw, @opt, @hash) if @geometry.is_a? Enumerable @geometry.each { |geom| io.optimize_images(geom) } else io.optimize_images(@geometry) io.create_symlink(@symlink, @geometry) end end |