]>
Commit | Line | Data |
---|---|---|
7dc32473 MG |
1 | package Gruntmaster::Page::CSS; |
2 | ||
7dc32473 | 3 | use Gruntmaster::Page::Base; |
7dc32473 MG |
4 | use CSS::Minifier::XS qw/minify/; |
5 | ||
6 | sub 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 | 15 | 1 |