I am looking into minifying (remove comments, new lines, whitespaces) the CSS output of S9Y using this php program as a replacement css file:
Code: Select all
<?php
header('Content-type: text/css');
ob_start("compress");
function compress($buffer) {
/* remove comments */
$buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer);
/* remove tabs, spaces, newlines, etc. */
$buffer = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $buffer);
return $buffer;
}
/* your css files */
include('style.css');
ob_end_flush();
?>
As I now realized, the serendipity.css file is constructed not only from my template style, but also fallback and plugins.
Is there a) a way to get this script working anyway or b) where would one insert this code directly in s9y (so where is the css generated)?
Daniel