]> iEval git - gruntmaster-page.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

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

index 2b025b150581082049e9a4feb1d00aa7673a47c7..6f86eb4000552f0305115281d414563a5332706a 100644 (file)
@@ -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 css/logos.css static/logos.png static/js.map static/js/'
        },
        BUILD_REQUIRES    => {
                qw/CSS::Minifier::XS          0
@@ -32,11 +32,10 @@ WriteMakefile(
                   strict      0
                   warnings    0
 
-                  Email::Simple                    0
-                  Email::Sender::Simple            0
                   File::Slurp                      0
                   Gruntmaster::Data                0
-                  HTML::Seamstress                 0
+                  HTML::Element::Library           0
+                  HTML::TreeBuilder                0
                   JSON::MaybeXS                    0
                   Log::Log4perl                    0
                   PerlX::Maybe                     0
index 8aa42d276d398e0e381352ac199b8111dde104e4..c02e7dd3f023cbdbd84c402f36cc0d85cabbcd06 100644 (file)
@@ -14,9 +14,6 @@ use Web::Simple;
 use Gruntmaster::Data;
 use Plack::App::Gruntmaster::HTML;
 
-use Email::Sender::Simple qw/sendmail/;
-use Email::Simple;
-
 use warnings NONFATAL => 'all';
 no warnings 'illegalproto';
 
index 7b343b22bb45c15ba067e792f0c611b7e9c8adf5..396f7d9fbdc93e54964e25c869543a37c90bb042 100644 (file)
@@ -4,7 +4,8 @@ use parent qw/Exporter/;
 our @EXPORT = qw/render render_article/;
 
 use File::Slurp qw/read_file/;
-use HTML::Seamstress;
+use HTML::Element::Library;
+use HTML::TreeBuilder;
 use POSIX qw//;
 use Data::Dumper qw/Dumper/;
 
@@ -45,7 +46,7 @@ sub HTML::Element::namedlink {
 my %page_cache;
 for (<tmpl/*>) {
        my ($tmpl, $lang) = m,tmpl/(\w+)\.(\w+),;
-       my $builder = HTML::Seamstress->new;
+       my $builder = HTML::TreeBuilder->new;
        $builder->ignore_unknown(0);
        $page_cache{$tmpl, $lang} = $builder->parse_file($_);
 }
@@ -74,7 +75,7 @@ sub _render {
        $process->($tree, %args) if $process;
        $_->detach for $tree->look_down(static => $args{static} ? 'no' : 'yes');
        $_->attr('static', undef) for $tree->look_down(sub {$_[0]->attr('static')});
-       $_->attr('smap', undef) for $tree->look_down(sub {$_[0]->attr('defmap')});
+       $_->attr('smap', undef) for $tree->look_down(sub {$_[0]->attr('smap')});
        $tree->as_HTML;
 }
 
index 489652a421a4db89db15774b32b758e2f8d95664..4d737fa3d7c330c28a8bb9c477f941c5e9ca2b10 100644 (file)
@@ -6,6 +6,7 @@ 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';
@@ -36,6 +37,11 @@ sub make_sprite {
        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>;
@@ -44,6 +50,7 @@ sub make_css {
                my $css = read_file $_;
                $css .= $common_css;
                write_file "static/css/$theme.css", CSS::Minifier::XS::minify $css;
+               gzip_file "static/css/$theme.css";
        }
 }
 
@@ -58,6 +65,7 @@ sub make_js {
                $js .= read_file $_ for <js/*.js>;
                write_file 'static/js.js', JavaScript::Minifier::XS::minify $js;
        }
+       gzip_file 'static/js.js';
 }
 
 my $css_mtime = -M 'static/css/slate.css' // 0;
This page took 0.030967 seconds and 4 git commands to generate.