]> iEval git - plack-app-gruntmaster.git/commitdiff
Merge branch 'master' into newmc
authorMarius Gavrilescu <marius@ieval.ro>
Thu, 2 Apr 2015 08:11:59 +0000 (11:11 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Thu, 2 Apr 2015 08:11:59 +0000 (11:11 +0300)
Conflicts:
Makefile.PL
make_static.PL

1  2 
Makefile.PL
lib/Plack/App/Gruntmaster/HTML.pm
make_static.PL

diff --cc Makefile.PL
index 2b025b150581082049e9a4feb1d00aa7673a47c7,6da9ecfdcc774618a09f3f493a534a5001f2746a..6f86eb4000552f0305115281d414563a5332706a
@@@ -10,7 -10,7 +10,7 @@@ WriteMakefile
        LICENSE           => 'AGPL_3',
        SIGN              => 1,
        clean             => {
-               FILES => 'static/css/ static/js.js css/logos.css static/logos.png static/js.map static/js/'
 -              FILES => 'static/css/ static/js.js static/js.js.gz static/js.map static/js/'
++              FILES => 'static/css/ static/js.js static/js.js.gz css/logos.css static/logos.png static/js.map static/js/'
        },
        BUILD_REQUIRES    => {
                qw/CSS::Minifier::XS          0
Simple merge
diff --cc make_static.PL
index 489652a421a4db89db15774b32b758e2f8d95664,10532b9a8dbd502663ba66c505f36b92534d592c..4d737fa3d7c330c28a8bb9c477f941c5e9ca2b10
@@@ -3,39 -3,19 +3,45 @@@ use v5.14
  use warnings;
  
  use CSS::Minifier::XS qw//;
 +use CSS::SpriteMaker;
  use JavaScript::Minifier::XS qw//;
  
+ use IO::Compress::Gzip qw/gzip/;
  use File::Slurp qw/read_file write_file/;
  
  mkdir 'static';
  mkdir 'static/css';
  
 +sub make_sprite {
 +      my $maker = Local::CSS::SpriteMaker->new(
 +              css_class_prefix => 'logo-',
 +              rc_override_classname => sub {
 +                      my ($name) = @_;
 +                      $name =~ s/-light/.logo-light/r;
 +              }
 +      );
 +
 +      $maker->make_sprite(
 +              source_images     => ['logos/'],
 +              target_file       => 'static/logos.png',
 +              add_extra_padding => 10,
 +      );
 +
 +      $maker->print_css(
 +              filename        => 'css/logos.css',
 +              sprite_filename => '/static/logos.png',
 +      );
 +
 +      system 'pngnq-s9', '-s1', 'static/logos.png';
 +      system 'optipng', '-o7', '-zm1-9', 'static/logos-nq8.png';
 +      rename 'static/logos-nq8.png', 'static/logos.png';
 +}
 +
+ sub gzip_file {
+       my ($file) = @_;
+       gzip $file => "$file.gz", -Level => 9, Minimal => 1;
+ }
  sub make_css {
        my $common_css;
        $common_css .= read_file $_ for <css/*.css>;
This page took 0.029445 seconds and 4 git commands to generate.