summaryrefslogtreecommitdiff
path: root/src/lib/template.source.sh
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-14 22:39:17 +0300
committerPaul Buetow <paul@buetow.org>2026-06-14 22:39:17 +0300
commit0f0662850ad2df3502241cd1bdfcb366dd68d717 (patch)
tree68ecdf0b67127ef6ce2fabca2c2ccefe8305de76 /src/lib/template.source.sh
parentcbfedd8f51d605ae8851b767ac21c00b877c33b7 (diff)
um0 add per-camera filter pages
Implement render_camera_pages <html_dir> <backhref> in stats.source.sh: one camera-<slug>.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 <noreply@anthropic.com>
Diffstat (limited to 'src/lib/template.source.sh')
-rw-r--r--src/lib/template.source.sh4
1 files changed, 3 insertions, 1 deletions
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'