% for my $d (@$dd) {
% my ($ddd, $fff, $iii) = listdir $real . "/" . $d->name;
% my $tn;
-% if ($iii) { $tn = join_paths $path, $d->name . "/" . $iii->name; }
+% if ($iii) { $tn = join_paths $path, $d->name, $iii->name; }
% else { $tn = undef; }
- <& .thumbnail, target => $d->name . "/", img => $tn,
- caption => $m->interp->apply_escapes($d->name, "h"),
- comment => $d->comment &>\
+ <& .thumbnail, target => $d->name . "/", comment => $d->comment,
+ img => $tn, size => "bigthumb",
+ caption => $m->interp->apply_escapes($d->name, "h") &>\
% }
</div>
% }
<h2>Images</h2>
<div class=gallery>
% for my $f (@$ff) {
- <& .thumbnail, target => $f->name, img => $path . $f->name,
- caption => $m->interp->apply_escapes($f->name, "h"),
- comment => $f->comment &>\
+ <& .thumbnail, target => $f->name, comment => $f->comment,
+ img => $path . $f->name, size => "bigthumb",
+ caption => $m->interp->apply_escapes($f->name, "h") &>\
% }
</div>
% }
%
<div class=thumbstrip>
% for my $f (@$ff) {
- <& .thumbnail, target => $f->name, img => $dir . "/" . $f->name,
+% my $img = $dir . "/" . $f->name;
+ <& .thumbnail, target => $f->name, img => $img, size => "bigthumb",
caption => $m->interp->apply_escapes($f->name, "h"),
focus => $f->name eq "$base$ext" &>\
% }
%###-------------------------------------------------------------------------
<%def .thumbnail>\
% my $tn;
-% if (defined $img) { $tn = scaled "thumb", $img; }
+% if (defined $img) { $tn = scaled $size, $img; }
% else { $tn = "$STATICURL/folder.svg"; }
% if ($focus) {
- <div class=pic id=focusthumb>
- <img class=thumb src="<% $tn |u %>">
- <div class=caption><span class=name><% $caption %></span></div>
+ <figure class="thumb <% $size %>" id=focusthumb>
+ <img class="thumb <% $size %>" load=lazy src="<% $tn |u %>">
+ <figcaption><span class=name><% $caption %></span></figcaption>
% } else {
- <div class=pic>
- <a class=pic href="<% $target |u %>">
- <img class=thumb src="<% $tn |u %>">
- <div class=caption>
+ <figure class="thumb <% $size %>">
+ <a class=thumb href="<% $target |u %>">
+ <img class="thumb <% $size %>" load=lazy src="<% $tn |u %>">
+ <figcaption>
<span class=name><% $caption %></span>
% if (defined $comment) {
<span class=comment><% $comment %></span>
% }
- </div>
+ </figcaption>
</a>
% }
- </div>
+ </figure>
%
<%args>
$target
$img
+ $size
$caption
$comment => undef
$focus => 0