Created
May 16, 2011 15:00
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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