Skip to content

Instantly share code, notes, and snippets.

@jcleveley-zz
Created May 16, 2011 15:00
Show Gist options
  • Save jcleveley-zz/974597 to your computer and use it in GitHub Desktop.
Save jcleveley-zz/974597 to your computer and use it in GitHub Desktop.
A proposal for using assetic to create inline javascript - useful for mobile development where you need to keep requests down.
<!-- Use case 1 - Minify inline javascript -->
{% javascripts filter="yui_js"%}
<script>
console.log('foo');
// these dissapear
//
</script>
{% endjavascripts %}
<!-- Use case 2 - Minify and embed external javascript file -->
{% javascripts 'path/to/file.js' output="inline" filter='yui_js' %}
<script>{{ output }}</script>
{% endjavascripts %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment