}
(my $nosl = $path) =~ s!/$!!;
+ my $size = "medthumb";
my %tn;
for my $f (@$ff)
{ $tn{$f} = TrivGal::Image->new($path . $f->name); }
for my $d (@$dd) {
- my ($ddd, $fff, $iii) = listdir $real . "/" . $d->name;
- $tn{$d} = $iii ?
- TrivGal::Image->new(join_paths $path, $d->name, $iii->name) :
- undef;
+ my $p = join_paths $path, $d->name;
+ DIR: for (;;) {
+ my ($ddd, $fff, $iii) = listdir join_paths $IMGROOT, $p;
+ if (defined $iii) {
+ my $index = join_paths $p, $iii->name;
+ $tn{$d} = TrivGal::Image->new($index);
+ last DIR;
+ }
+ if (!@$ddd) { $tn{$d} = undef; last DIR; }
+ $p = join_paths $p, $ddd->[0]->name;
+ }
}
</%perl>
%
%
% if (@$dd) {
<h2>Subfolders</h2>
-% for my $size (qw{medthumb}) {
<div class="gallery <% $size %>">
-% for my $d (@$dd) {
+% for my $d (@$dd) {
<& .thumbnail, target => $d->name, comment => $d->comment,
img => $tn{$d}, size => $size,
caption => $m->interp->apply_escapes($d->name, "h") &>\
-% }
-</div>
% }
+</div>
% }
%
% if (@$ff) {
<h2>Images</h2>
-% for my $size (qw{medthumb}) {
<div class="gallery <% $size %>">
-% for my $f (@$ff) {
+% for my $f (@$ff) {
<& .thumbnail, target => $f->name, comment => $f->comment,
- img => $tn{$f}, size => "bigthumb",
+ img => $tn{$f}, size => $size,
caption => $m->interp->apply_escapes($f->name, "h") &>\
-% }
-</div>
% }
+</div>
% }
%
<div class=fill></div>
% for my $f (@$ff) {
<& .thumbnail, target => $f->name, img => $img{$f}, size => $size,
caption => $m->interp->apply_escapes($f->name, "h"),
- focus => $f->name eq "$base$ext" &>\
+ focus => $f eq $this &>\
% }
</div>
% }
% else { $tn = "$STATICURL/folder.svg"; }
% if ($focus) {
<figure class="thumb focusthumb <% $size %>">
- <img class="thumb <% $size %>" load=lazy src="<% $tn |u %>">
+ <img class="thumb <% $size %>" load=lazy src="<% $tn |h %>">
<figcaption><span class=name><% $caption %></span></figcaption>
% } else {
<figure class="thumb <% $size %>">
<a class=thumb href="<% $target |u %>">
- <img class="thumb <% $size %>" load=lazy src="<% $tn |u %>">
+ <img class="thumb <% $size %>" load=lazy src="<% $tn |h %>">
<figcaption>
<span class=name><% $caption %></span>
% if (defined $comment) {