Skip to content
This repository has been archived by the owner on Apr 4, 2018. It is now read-only.

Commit

Permalink
Added notes about CSS rewriting tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
fidothe committed Apr 12, 2011
1 parent 01c3c17 commit 98c1dc2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -24,6 +24,8 @@ In your `environments/production.rb`:
config.action_controller.asset_host = "http://cdn.url.gov.uk"
config.action_controller.asset_path = CdnHelpers::AssetPath

The gem also make the `rake` task `cdn:css_urls` available to you. This is for post-deployment rewriting of URLs within CSS files. It's destructive - it rewrites the files in place - but it doesn't require that the config vars above are set since it leaves URLs as absolute local URLs.

Django
------

Expand All @@ -49,3 +51,5 @@ in templates use the `asset_url` helper:

<img src="{% asset_url "/images/thing.png" %}">
<img src="{% asset_url thing.image.src %}">

The app provides the `cdn_css` command for `manage.py`. This uses the Ruby script process_css to do the heavy lifting, but relies on the `MEDIA_ROOT` and `MEDIA_URL` settings in `settings.py` to tell where to look and how to construct the URLs.

0 comments on commit 98c1dc2

Please sign in to comment.