miracle2k / django-assets

Django webassets integration.
BSD 2-Clause "Simplified" License
89 stars 79 forks source link

Add convenience methods to easily add JS or CSS assets #37

Closed ustun closed 5 years ago

ustun commented 10 years ago

Instead of

{% assets filters="jsmin", output="gen/packed.js", "common/jquery.js", "site/base.js", "site/widgets.js" %}
    <script type="text/javascript" src="{{ ASSET_URL }}"></script>
{% endassets %}

it would be better if we could just do

{% assetsjs filters="jsmin", output="gen/packed.js", "common/jquery.js", "site/base.js", "site/widgets.js" %}

It could even detect that it is a js file, so we wouldn't have to have different asset tags like assetscss etc.

Usage: assetsjs and assetscss take the same inputs as the assets tag.

{% assetsjs "foo_js" %} or {% assetscss "foo_css" %}

No end tags are needed.

ustun commented 10 years ago

Hi @miracle2k , should I re-base this with 0.10 and re-submit?