]> iEval git - gruntmaster-page.git/blame_incremental - lib/Gruntmaster/Page/CSS.pm
Import some changes from the mindcoding branch
[gruntmaster-page.git] / lib / Gruntmaster / Page / CSS.pm
... / ...
CommitLineData
1package Gruntmaster::Page::CSS;
2
3use Gruntmaster::Page::Base;
4use CSS::Minifier::XS qw/minify/;
5
6sub generate{
7 my ($self, $format, $env, $theme) = @_;
8 debug $env => "theme is $theme";
9 return [404, ['Content-Type' => 'text/plain'], [ 'Not found' ]] unless -e "css/themes/$theme.css";
10 my $css = read_file "css/themes/$theme.css";
11 $css .= read_file $_ for <css/*.css>;
12 [200, ['Content-Type' => 'text/css', 'Cache-Control' => 'public, max-age=604800', 'X-Forever' => 1], [minify $css] ]
13}
14
151
This page took 0.02459 seconds and 4 git commands to generate.