diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-25 17:44:37 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-25 17:44:37 +0300 |
| commit | bef8a7af35174ebb065f240aacf3c51ccf50d460 (patch) | |
| tree | 25414e675e2040890cd8115aa70761e29f70c425 /src/lib/album-render.source.sh | |
| parent | 12b2733dab6da12a2a6cf1d27d69bc7d143f5dfc (diff) | |
Fill the album's short final page with a full-row tile
A short final preview page (e.g. one leftover photo when the photo count
isn't a multiple of the page size) can't be aligned to a multiple of 12
cells, so it left an orphaned bottom-right corner. The album's LAST page
now widens its leftover final single tile into a "fill" tile spanning the
whole row (grid-column: 1 / -1) at any breakpoint, so the bottom edge is
flush; object-fit: cover keeps the wider crop undistorted.
append_preview_grid takes a fill_last flag: render_full_preview_page sets
it only for the page with no "next" link; stats mini-albums pass 'no' so
their small galleries are unaffected. build_tile_block gains a 'fill'
layout and header.tmpl an a.fill-row rule.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'src/lib/album-render.source.sh')
| -rw-r--r-- | src/lib/album-render.source.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/album-render.source.sh b/src/lib/album-render.source.sh index 4c65f69..fa8173f 100644 --- a/src/lib/album-render.source.sh +++ b/src/lib/album-render.source.sh @@ -121,10 +121,16 @@ render_full_preview_page() { # also groups the page's photos into tiles (some subdivided into smaller # thumbnails), so the per-page ordering and preview numbering stay here. local preview_thumbs='' + # The album's last page (no "next" link) is the only one allowed to widen a + # leftover final tile to a full row, so a short final page stays flush. + local fill_last='no' + if [ -z "$next_page" ]; then + fill_last='yes' + fi # The main album's view pages are "<page_num>-<preview_num>.html", so the # shared grid builder gets "<page_num>-" as the href prefix. append_preview_grid preview_thumbs \ - "$thumbs_dir" "$backhref" "$page_num-" "$@" + "$thumbs_dir" "$backhref" "$page_num-" "$fill_last" "$@" template previewpage "$page_name.html" \ html_dir "$html_dir" \ preview_thumbs "$preview_thumbs" |
