bastianallgeier/kirbycms — pull request #20 by vis7mac (2012-06-17 05:47:56+00:00)
Title: Compress

So, here's my next new feature:

Now you can let Kirby combine all of your CSS/JS files into one and save a lot of HTTP requests.
There's also an option to minify all data and so remove comments and whitespace.
Just don't use the returns of the css() and js() functions but then use co::css($indent, "screen", "print", -1) and co::js($indent) to get back the smallest number of style and script tags possible. This works fully automatically based on all previous calls of css() and js().
$indent is the stuff to print out before each line, for example one tab or 2 spaces (depending on your template).
"screen", "print" and so on is the media you want to have get back, -1 contains "not given", that's if you did not give a $media to the css($url, $media) function.
To use the compress option, you also have to turn caching on in config.php.

Now there's a new function called less() working like css() to let Kirby auto compile LESS files and cache them (so that only works with 'cache' set to true).

The new minifier 'HTML' is not used in the moment, we'll have to wait until the placeholders are finished and published so that I can re-fork the repo and add the support for this (it requires an addition to global placeholders).