Sprockets Relative URL support
Fixes relative URLs in CSS assets using Sprockets.
Each asset is resolved from Sprockets, and its relative URL will be rewritten to
use a precompiled version. By adding this preprocessor, CSS frameworks can be
minified and combined into your application.css
file without any need to
rewrite the url()
values in their CSS.
Tested with:
- Rails
- TODO: Sinatra
Installation
Add this line to your application's Gemfile:
gem 'sprockets_relative_url'
Usage
Rails
Add the processor to the Rails asset pipeline:
Rails.application.assets
.register_postprocessor('text/css', SprocketsRelativeUrl::Processor)
Sinatra
TODO
Contributing
- Fork it ( https://github.com/smangelsdorf/sprockets_relative_url/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request