]> iEval git - gruntmaster-page.git/blobdiff - lib/Gruntmaster/Page/CSS.pm
Heeere's Plack/PSGI!
[gruntmaster-page.git] / lib / Gruntmaster / Page / CSS.pm
diff --git a/lib/Gruntmaster/Page/CSS.pm b/lib/Gruntmaster/Page/CSS.pm
new file mode 100644 (file)
index 0000000..a3e227f
--- /dev/null
@@ -0,0 +1,23 @@
+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 $css = read_file "css/themes/$theme.css";
+       $css .= read_file $_ for <css/*.css>;
+       [200, ['Content-Type' => 'text/css', 'Cache-Control' => 'max-age=604800'], [minify $css] ]
+}
+
+sub variants{ [[css => 1, 'text/css', undef, undef, undef, undef]] }
+
+1
This page took 0.02057 seconds and 4 git commands to generate.