X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FCSS.pm;h=912e948a03600febf1f189a3dc3fe9126d2c389d;hb=5c6aea9392c11422abe85788aac0f62ad3a4dd14;hp=a6f647a5f924846cbabb0607893158c67acc2644;hpb=5a2112d32984d8621a6fb8a461b85ddf9c37e9ba;p=gruntmaster-page.git diff --git a/lib/Gruntmaster/Page/CSS.pm b/lib/Gruntmaster/Page/CSS.pm index a6f647a..912e948 100644 --- a/lib/Gruntmaster/Page/CSS.pm +++ b/lib/Gruntmaster/Page/CSS.pm @@ -1,24 +1,15 @@ package Gruntmaster::Page::CSS; -use 5.014000; -use strict; -use warnings; use Gruntmaster::Page::Base; -our @ISA = qw/Gruntmaster::Page::Base/; -our $VERSION = '0.001'; - -use File::Slurp qw/read_file/; use CSS::Minifier::XS qw/minify/; sub generate{ - my ($self, $format, $logger, $theme) = @_; - debug $logger => "theme is $theme"; + my ($self, $format, $env, $theme) = @_; + debug $env => "theme is $theme"; return [404, ['Content-Type' => 'text/plain'], [ 'Not found' ]] unless -e "css/themes/$theme.css"; my $css = read_file "css/themes/$theme.css"; $css .= read_file $_ for ; - [200, ['Content-Type' => 'text/css', 'Cache-Control' => 'public, max-age=604800'], [minify $css] ] + [200, ['Content-Type' => 'text/css', 'Cache-Control' => 'public, max-age=604800', 'X-Forever' => 1], [minify $css] ] } -sub variants{ [[css => 1, 'text/css', undef, undef, undef, undef]] } - 1