summaryrefslogtreecommitdiff
path: root/util/skingen.pl
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-10-24 15:18:34 +0200
committerYorhel <git@yorhel.nl>2009-10-24 15:19:10 +0200
commit5251f791de0a0e1684107b373a08cfe3a17fc447 (patch)
tree53d39d0456b464bf4525020b8503ae2d0c98b1bc /util/skingen.pl
parent8243d0b30d015c2464c34b02dd4e3ecf1c599762 (diff)
parenta8921887bddb7242a95e99b5177aff6ff6cd11be (diff)
Merge branch 'beta'2.8
+ ChangeLog update
Diffstat (limited to 'util/skingen.pl')
-rwxr-xr-xutil/skingen.pl18
1 files changed, 5 insertions, 13 deletions
diff --git a/util/skingen.pl b/util/skingen.pl
index e27ea4a1..73e4fdc7 100755
--- a/util/skingen.pl
+++ b/util/skingen.pl
@@ -5,13 +5,12 @@ package VNDB;
use strict;
use warnings;
use Cwd 'abs_path';
-use Data::Dumper 'Dumper';
use Image::Magick;
+eval { require CSS::Minifier::XS };
our($ROOT, %O);
BEGIN { ($ROOT = abs_path $0) =~ s{/util/skingen\.pl$}{}; }
-require $ROOT.'/data/global.pl';
if(@ARGV) {
@@ -78,19 +77,12 @@ sub writeskin { # $obj
# write the CSS
open my $CSS, '<', "$ROOT/data/style.css" or die $!;
+ my $css = join '', <$CSS>;
+ close $CSS;
+ $css =~ s/\$$_\$/$o->{$_}/g for (keys %$o);
open my $SKIN, '>', "$ROOT/static/s/$o->{_name}/style.css" or die $!;
- while((my $d = <$CSS>)) {
- if($O{debug}) {
- chomp $d;
- $d =~ s/^\s*/ /;
- $d =~ s{/\*.+\*/}{}; # NOTE: multiline comments or multiple comments per line won't work
- next if $d !~ /[^\s\t]/;
- }
- $d =~ s/\$$_\$/$o->{$_}/g for (keys %$o);
- print $SKIN $d;
- }
+ print $SKIN $CSS::Minifier::XS::VERSION ? CSS::Minifier::XS::minify($css) : $css;
close $SKIN;
- close $CSS;
}