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