# 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) 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. - It allows you to specify dependencies between your assets and automatically concatenates them. - It allows you to minify/compress your JavaScript and CSS assets using compressor you like: YUI, SASS, Uglifier or no compression at all. - It supports JavaScript templates for client-side rendering of strings or markup. JavaScript templates have the special format extension `.jst` and are compiled to JavaScript functions. - Adds MD5 fingerprint suffix for _cache busting_. That means your `app.css` will become `app-908e25f4bf641868d8683022a5b62f54.css`. See `cachebust` configuration option for other variants. - Produce gzipped versions of assets. See `gzip` configuration option for details. - [Compass][compass], [Bourbon][bourbon] and [Neat][neat] built-in support. See "Custom Vendors" below. - [Rails Assets][rails_assets] support - [Autoprefixer][autoprefixer] support [compass]: http://compass-style.org/ [bourbon]: http://bourbon.io/ [neat]: http://neat.bourbon.io/ [autoprefixer]: https://github.com/postcss/autoprefixer [rails_assets]: https://rails-assets.org/ Jekyll-Assets uses fabulous [Sprockets][sprockets] under the hood, so you may refer to Rails guide about [Asset Pipeline][rails-guide] for detailed information about amazing features it gives you. *Note:* You must have an [ExecJS][extjs] supported runtime in order to use CoffeeScript. [rails-guide]: http://guides.rubyonrails.org/asset_pipeline.html [sprockets]: https://github.com/sstephenson/sprockets#readme [extjs]: https://github.com/sstephenson/execjs#readme For a quick start check out [jekyll-assets introduction][jekyll-assets-intro] that shows how to use it step by step. Also you might want to take a look on [my blog sources][ixti-blog-src] as a real-world example as well. [jekyll-assets-intro]: http://ixti.net/software/2012/12/30/unleash-mr-hyde-introduction-of-jekyll-assets.html [ixti-blog-src]: https://github.com/ixti/ixti.github.com ## Installation Add this line to your application's Gemfile: gem 'jekyll-assets' And then execute: $ bundle Or install it yourself as: $ gem install jekyll-assets ## How to Use Jekyll-Assets First of all make sure to require it. Common practice is to add following line into `_plugins/ext.rb` file: ``` ruby require "jekyll-assets" ``` Once plugin installed, you'll have following Liquid tags available: - `{% javascript app %}`: Generates ` {% asset_path "my logo.png" %} {% asset_path 'my logo.png' %} ``` Also you'll have complimentary Liquid filters as well: - `{{ 'app' | javascript }}`: Generates `