From 0f0662850ad2df3502241cd1bdfcb366dd68d717 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 14 Jun 2026 22:39:17 +0300 Subject: um0 add per-camera filter pages Implement render_camera_pages in stats.source.sh: one camera-.html per camera in STATS_CAMERA_SLUGS, reusing the aggregation's collision-resolved slugs and per-camera photo lists so filenames match pm0's leaderboard links. Each page reuses the shared header/footer chrome plus a new camera.tmpl that renders an HTML-escaped camera heading, a pre-built thumbnail grid, and a back-to-stats link. Thumbnails reuse preview.tmpl's markup style (thumb image from thumbs/) but link to the full-size image under photos/ rather than a per-photo view page, since the view-page name is not derivable outside the album pagination loop. The photos and thumbs dir names are fixed to match generate()'s render_album_pages call. Cameras are walked in LC_ALL=C label order for reproducible output, and cameras with no recorded photos are skipped. Adds the camera_name/camera_thumbs render field specs and a tests/cli.sh case covering per-camera files, slug collisions, HTML escaping, thumbnail link targets, and determinism. This provides the function + template + tests only; wiring into generate() and the STATS_PAGE toggle remain for rm0. Co-Authored-By: Claude Opus 4.8 --- src/lib/template.source.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib/template.source.sh') diff --git a/src/lib/template.source.sh b/src/lib/template.source.sh index 6d48ae5..9fd3ad4 100644 --- a/src/lib/template.source.sh +++ b/src/lib/template.source.sh @@ -144,9 +144,11 @@ current_date_text_to() { declare -ra TEMPLATE_RENDER_FIELD_SPECS=( 'render_animation_class_html|context_html|animation_class|animation_class|preview details view' 'render_backhref_css|context_css|backhref|backhref|header splash' - 'render_backhref_html|context_html|backhref|backhref|footer header preview splash details view stats' + 'render_backhref_html|context_html|backhref|backhref|footer header preview splash details view stats camera' 'render_background_image_css|context_css|background_image|background_image|header splash' 'render_blurs_dir_css|context_css|blurs_dir|blurs_dir|header splash' + 'render_camera_name_html|context_html|camera_name|camera_name|camera' + 'render_camera_thumbs_html|context_raw|camera_thumbs|camera_thumbs|camera' 'render_current_date_text|current_date_html|||' 'render_enter_page_html|context_html|enter_page|enter_page|splash' 'render_exif_details_html|context_raw|exif_details|exif_details|details' -- cgit v1.2.3