Last active
December 13, 2015 20:29
-
-
Save foxiepaws/4970417 to your computer and use it in GitHub Desktop.
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/env perl | |
use vars qw(%c @p $s);use HTML::Template;our %c=(i=>"full/",t=>"thumbs/",p=> | |
"/home/fox/testg/",T=>"/home/fox/tmpls/");our @p;our $s=HTML::Template->new( | |
filename=>$c{T}.'single.tmpl');chdir $c{p}.$c{i};@p=<*.jpg>,<*.gif>,<*.png>, | |
<*.jpeg>;foreach(@p){if(!(-f $c{p}.$c{t}.$_)){system("convert ".$c{p}.$c{i}.$_ | |
." -thumbnail 260x180 ".$c{p}.$c{t}.$_)}}open (G,">".$c{p}."index.html");print | |
G (sub{my $a=HTML::Template->new(filename=>$c{T}.'index.tmpl');my @b;foreach( | |
@p){my %d;$d{LINK}="$_.html";$d{THUMB}=$c{t}.$_;push @b,\%d}$a->param(GALLERY | |
=>\@b);return $a->output})->();close G;my $a=scalar @p;for(my $b=0;$b<$a;$b++){ | |
my($d,$e);if($b==0){$d=$p[$a-1];$e=$p[$b+1]}elsif($b==$a-1){$d=$p[$b-1];$e=$p[0] | |
}else{$d=$p[$b-1];$e=$p[$b+1]}my $f=$p[$b];open(G,">".$c{p}.$p[$b].".html"); | |
print G (sub{my($a,$b,$c)=@_;$s->param(PATH=>$c{i}.$a,PREV=>"$b.html",NEXT=> | |
"$c.html");return $s->output})->($f,$d,$e);close G} |
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/env perl | |
use vars qw(%c @p $s);use HTML::Template;our %c=(i=>"full/",t=>"thumbs/",p=>"/home/fox/testg/",T=>"/home/fox/tmpls/");our @p;our $s=HTML::Template->new(filename=>$c{T}.'single.tmpl');chdir $c{p}.$c{i};@p=<*.jpg>,<*.gif>,<*.png>,<*.jpeg>;foreach(@p){if(!(-f $c{p}.$c{t}.$_)){system("convert ".$c{p}.$c{i}.$_." -thumbnail 260x180 ".$c{p}.$c{t}.$_)}}open (G,">".$c{p}."index.html");print G (sub{my $a=HTML::Template->new(filename=>$c{T}.'index.tmpl');my @b;foreach(@p){my %d;$d{LINK}="$_.html";$d{THUMB}=$c{t}.$_;push @b,\%d}$a->param(GALLERY=>\@b);return $a->output})->();close G;my $a=scalar @p;for(my $b=0;$b<$a;$b++){my($d,$e);if($b==0){$d=$p[$a-1];$e=$p[$b+1]}elsif($b==$a-1){$d=$p[$b-1];$e=$p[0]}else{$d=$p[$b-1];$e=$p[$b+1]}my $f=$p[$b];open(G,">".$c{p}.$p[$b].".html");print G (sub{my($a,$b,$c)=@_;$s->param(PATH=>$c{i}.$a,PREV=>"$b.html",NEXT=>"$c.html");return $s->output})->($f,$d,$e);close G} |
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/env perl | |
use vars qw(%c @p $s);use HTML::Template;our %c=(i=>"full/",t=>"thumbs/",p=> | |
"/home/fox/testg/",T=>"/home/fox/tmpls/");our @p;our $s=HTML::Template->new( | |
filename=>$c{T}.'single.tmpl');chdir $c{p}.$c{i};@p=<*.jpg>,<*.gif>,<*.png>, | |
<*.jpeg>;foreach(@p){if(!(-f $c{p}.$c{t}.$_)){system("convert ".$c{p}.$c{i}. | |
$_." -thumbnail 260x180 ".$c{p}.$c{t}.$_)}}open (G,">".$c{p}."index.html"); | |
print G (sub{my $a=HTML::Template->new(filename=>$c{T}.'index.tmpl');my @b; | |
foreach(@p){my %d;$d{LINK}="$_.html";$d{THUMB}=$c{t}.$_;push @b,\%d}$a->param | |
(GALLERY=>\@b);return $a->output})->();close G;print(',.(!o'^'foxie');my $a= | |
scalar @p;for(my $b=0;$b<$a;$b++){my($d,$e);if($b==0){$d=$p[$a-1];$e=$p[$b+1]} | |
elsif($b==$a-1){$d=$p[$b-1];$e=$p[0]}else{$d=$p[$b-1];$e=$p[$b+1]}my $f=$p[$b]; | |
open(G,">".$c{p}.$p[$b].".html");print G (sub{my($a,$b,$c)=@_;$s->param(PATH=> | |
$c{i}.$a,PREV=>"$b.html",NEXT=>"$c.html");return $s->output})->($f,$d,$e);close G} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment