What is an Asset Pipeline

From http://guides.rubyonrails.org/asset_pipeline.html:

The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass and ERB.

Introduction to Jekyll-Assets

Jekyll-Assets is an asset pipeline for Jekyll. Documents and tutorials:

Deployment of Jekyll-Assets

  • Install gems:

    gem install jekyll-assets sass uglify
  • Configure assets in _config.yml:

    gems: [jekyll-assets]
        prefix: "/assets"
            -   _assets/css
            -   _assets/img
            -   _assets/js
            css: sass
            js: uglifier
            automatic_img_alt: true
            automatic_img_size: false
  • Add assets:

    cd <jekyll_dir>
    mkdir -p _assets/{css,js,img}
    touch _assets/css/main.scss
    touch _assets/js/main.js
    touch _assets/img/main.jpg
  • Use assets in HTML pages:

    {% css main %}
    {% js main %}
    {% img main.jpg %}
    <img src="{% asset_path main.jpg %}">
  • Finally, build:

    jekyll build