README.md in jekyll-assets-2.0.0.pre.beta4 vs README.md in jekyll-assets-2.0.0

- old
+ new

@@ -41,11 +41,17 @@ assets: - "*.png" - "bundle.css" digest: true sources: - - "_assets/folder" + - _assets/css + - _assets/images + - _assets/javascripts + - _assets/stylesheets + - _assets/fonts + - _assets/img + - _assets/js ``` ### Digesting * Disable digesting by default in development. @@ -55,18 +61,27 @@ * Requires sass and uglify. * Disable compression by default in development. * Enable by default in production. -***You can force digesting with `digest: true` in your `_config.yml`*** -## ERB Support +### Bower (web components support.) -ERB Support is removed in favor of trying to get this included on Github Pages -eventually (if I can.) Having ERB presents a security risk to Github because it -would allow you to use Ruby in ways they don't want you to. +Modify your `.bowerrc` file and add: +```javascript +{ + "directory": "_assets/bower" +} +``` + +And then add `_assets/bower` to your sources list and Sprockets will do the +the rest for you... you can even `//= require bower_asset.js`. We will even +compress them for you per normal if Sprockets supports it and allows us to. + +***You can force digesting with `digest: true` in your `_config.yml`*** + ## Tags * image, img * javascript, js * stylesheet, css, style @@ -99,10 +114,53 @@ ### Current Proxies: * `sprockets:accept:<value>` * `sprockets:write_to:<value>` +## Liquid Variables in Arguments + +You can use Liquid variables inside of your arguments, but you must quote +them to get them to work, this can be a partial argument quote a full argument +quote or otherwise, it just must be quoted or escaped. + +```liquid +{% img '{{ image_path }}' %} +{% img '{{ image_path }}' proxy:key:'{{ value }}' %} +{% img {{\ image_path\ }} %} +``` + +## Getting a list of your assets and basic info from Liquid + +We provide all *your* assets as a hash of Liquid Drops so you can get basic +info that we wish you to have access to without having to prepare the class. + +```liquid +{{ assets["bundle.css"].content_type }} => "text/css" +{{ assets["images.jpg"].width }} => 62 +{{ assets["images.jpg"].height }} => 62 +``` + +The current list of available accessors: + +* `logical_path` +* `content_type` -> `type` +* `filename` +* `basename` +* `width` +* `height` + +If you would like more, please feel free to add a pull request, at this +time we will reject all pull requests that wish to add any digested paths as +those are dynamically created when a proxy is ran so we can never predict +it reliably unless we proxy and that would be a performance problem. + +## ERB Support + +ERB Support is removed in favor of trying to get this included on Github Pages +eventually (if I can.) Having ERB presents a security risk to Github because it +would allow you to use Ruby in ways they don't want you to. + ## Filters There is a full suite of filters, actually, any tag and any proxy can be a filter by way of filter arguments, take the following example: @@ -120,10 +178,18 @@ Jekyll::Assets::Hook.register :env, :init do # Your Work end ``` +## Sass Helpers + +***Our currently supported helpers are:*** + +* asset_path +* image_path +* font_path + ## Addons * CSS Auto Prefixer - add "autoprefixer-rails" to your Gemfile. * ES6 Transpiler (through Babel) - add "sprockets-es6" to your Gemfile. * Image Magick - add "mini_magick" to your Gemfile, only works with `img`, `image`. @@ -141,12 +207,16 @@ * `magick:format:<value>` * `magick:quality:<value>` * `magick:rotate:<value>` * `magick:crop:<value>` * `magick:flip:<value>` -* `magick:half` -* `magick:2x` -* `magick:4x` +* `magick:quadruple`, `magick:4x` +* `magick:one-third`, `magick:1/3` +* `magick:three-fourths`, `magick:3/4` +* `magick:two-fourths`, `magick:2/4` +* `magick:two-thirds`, `magick:2/3` +* `magick:one-fourth`, `magick:1/4` +* `magick:half`, `magick:1/2` ## Plugins where did they go? They're dead, in the way that they were, use Hooks, they require less patching and give more flexibility to us because we can trigger them every