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