README.md in jekyll-assets-0.13.0 vs README.md in jekyll-assets-0.14.0

- old
+ new

@@ -1,12 +1,12 @@ # Jekyll::AssetsPlugin -[![Gem Version](https://badge.fury.io/rb/jekyll-assets.png)](http://badge.fury.io/rb/jekyll-assets) -[![Build Status](https://secure.travis-ci.org/ixti/jekyll-assets.png)](http://travis-ci.org/ixti/jekyll-assets) -[![Dependency Status](https://gemnasium.com/ixti/jekyll-assets.png)](https://gemnasium.com/ixti/jekyll-assets) -[![Code Climate](https://codeclimate.com/github/ixti/jekyll-assets.png)](https://codeclimate.com/github/ixti/jekyll-assets) -[![Coverage Status](https://coveralls.io/repos/ixti/jekyll-assets/badge.png)](https://coveralls.io/r/ixti/jekyll-assets) +[![Gem Version](https://badge.fury.io/rb/jekyll-assets.svg)](http://badge.fury.io/rb/jekyll-assets) +[![Build Status](https://travis-ci.org/ixti/jekyll-assets.svg?branch=master)](http://travis-ci.org/ixti/jekyll-assets) +[![Dependency Status](https://gemnasium.com/ixti/jekyll-assets.svg)](https://gemnasium.com/ixti/jekyll-assets) +[![Code Climate](https://codeclimate.com/github/ixti/jekyll-assets.svg)](https://codeclimate.com/github/ixti/jekyll-assets) +[![Coverage Status](https://coveralls.io/repos/ixti/jekyll-assets/badge.svg?branch=master)](https://coveralls.io/r/ixti/jekyll-assets?branch=master) Jekyll plugin, that adds Rails-alike assets pipeline, that means that: - It allows you to write javascript/css assets in other languages such as CoffeeScript, Sass, Less and ERB. @@ -266,10 +266,47 @@ <img src="/assets/logo-68b329da9893e34099c7d8ad5cb9c940.png"> <img src="/assets/logo-68b329da9893e34099c7d8ad5cb9c940.png" width="50" height="50"> ``` +### Images resizing + +The image helper accepts an option param with [resize:dimension] switch. +If given the image will be resized to the appropriate dimensions. + +``` html +{% image huge-logo.png [resize:50x50] %} + +<!-- which will render something like: --> +<img src="/assets/logo-50x50-68b329da9893e34099c7d8ad5cb9c940.png"> +``` + +You can also mix auto resizing with dimension guessing + +``` html +{% image huge-logo.png [resize:50x50, autosize] %} + +<!-- Will be rendered like: --> +<img src="/assets/logo-50x50-68b329da9893e34099c7d8ad5cb9c940.png" width="50" height="50"> +``` + +This feature requires imagemagick to be installed, and the dimension is any +format that imagemagick understands: [Resize documentation][resize-doc]. + +More examples: +``` html +{% image image.png [resize:400x400] %} <!-- Fit whole image in these dimensions --> +{% image image.png [resize:!300x150] %} <!-- Ignore aspect ratio --> +{% image image.png [resize:200%] %} <!-- Resize by percentage --> +{% image image.png [resize:500@] %} <!-- Resize to specific pixel count --> +{% image image.png [resize:200x100^] %} <!-- Resize to fill area --> +{% image image.png [resize:<200x10] %} <!-- Only enlarge small image --> +{% image image.png [resize:>200x10] %} <!-- Only shrink large image --> +``` + +[resize-doc]: http://www.imagemagick.org/Usage/resize/#resize + ### Custom Compressors Sprockets comes with good set of preconfigured compressors, but imagine you are not satisfied with default settings. For example you want to strip all comments but copyrights info. In this case you can define and use your own compressor. @@ -646,19 +683,22 @@ [e-mail]: mailto://ixti@member.fsf.org ## Contributing -1. Fork it -2. Create your feature branch (`git checkout -b my-new-feature`) -3. Commit your changes (`git commit -am 'Added some feature'`) -4. Push to the branch (`git push origin my-new-feature`) -5. Create new Pull Request +* Fork [jekyll-assets][] on GitHub +* Make your changes +* Ensure all tests pass (`bundle exec rake`) +* Send a pull request +* If we like them we'll merge them +* If we've accepted a patch, feel free to ask for commit access! +[jekyll-assets]: https://github.com/ixti/jekyll-assets + ## License -Copyright (C) 2012-2013 Aleksey V Zapparov (http://ixti.net/) +Copyright (C) 2012-2015 Aleksey V Zapparov The MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in