This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub wrap { | |
my ($self, $data) = @_; | |
return $self->engine->process($self->path.'/layout.html', { | |
'//head' => { | |
'title' => $data->{title}, | |
'./script[last()-1]' => @{$data->{js}}?[map { './@src' => '/js/'.$_.'.js' }, @{$data->{js}}]:undef, | |
'./link[last()]' => @{$data->{js}}?[map { './@href' => '/css/'.$_.'.css'}, @{$data->{css}}]:undef, | |
'./script[last()]' => $data->{jscode}?sub { $_ =~ s/\/\*code\*\//$data->{jscode}/; \$_ }:undef, | |
}, | |
'//body' => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# s3sync: 1-way synchronization of your files with S3 storage with auto minify *.css and *.js files and gzip text/* content | |
use Modern::Perl; | |
use Amazon::S3; | |
use Path::Class (); | |
use IO::Compress::Gzip qw(gzip $GzipError); | |
use File::MMagic; | |
use JavaScript::Minifier::XS; |
NewerOlder