dp.cx blog

Posted on

Filed under jekyll, css, and javascript

I recently made a switch on this site to use combined assets (javascript / css files) on this blog. Jekyll Asset Pipeline actually made this fairly easy. You just rip out all your calls to add CSS/Javascript, and replace them with something like:

{% raw %} {% css_asset_tag global %} - /_assets/bootstrap-combined.min.css - /_assets/common.css {% endcss_asset_tag %}{% endraw %}


{% raw %} {% javascript_asset_tag global %} - /_assets/bootstrap.js - /_assets/common.js {% endjavascript_asset_tag %}{% endraw %}

Which is awesome! Because now, you've lowered the number of HTTP requests the page is making. And if you've pulled those resources from some other site, you're then removing an additional DNS lookup.

The only problem, for me anyway, is that I don't host this stuff at http://www.dp.cx/, it's at http://www.dp.cx/blog/. But Jekyll Asset Pipeline wants to put everything in /. Which is a problem for me. So I've created a pull request to fix that problem.