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
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
use Gruntmaster::Data;
use Plack::App::Gruntmaster::HTML;
-use Email::Sender::Simple qw/sendmail/;
-use Email::Simple;
-
use warnings NONFATAL => 'all';
no warnings 'illegalproto';
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/;
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($_);
}
$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;
}
use CSS::SpriteMaker;
use JavaScript::Minifier::XS qw//;
+use IO::Compress::Gzip qw/gzip/;
use File::Slurp qw/read_file write_file/;
mkdir 'static';
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>;
my $css = read_file $_;
$css .= $common_css;
write_file "static/css/$theme.css", CSS::Minifier::XS::minify $css;
+ gzip_file "static/css/$theme.css";
}
}
$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;