summaryrefslogtreecommitdiff
path: root/src/lib/stats-filter-album.source.sh
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-07-18 12:19:40 +0300
committerPaul Buetow <paul@buetow.org>2026-07-18 12:19:40 +0300
commit3c35381b71f992eb7a86552697ea647bb76b68b1 (patch)
tree56e478547e0cb47ac7403304c997846fb3fea8a4 /src/lib/stats-filter-album.source.sh
parenta7588bf270ef2c2f6dd2893d0129e526cbf8d89c (diff)
Add DETAILS_PAGE setting to make per-photo details pages optional
Album owners can now set DETAILS_PAGE=no (or pass --no-details) to skip generating each photo's *-details.html EXIF summary page and its "Details" navigation redirects, without touching the normal thumbnail overview, per-photo view pages, EXIF tooltips, or STATS_PAGE, which all stay independently controlled. Every "Details" link (on view pages and stats filter mini-album view pages) and every "-details" redirect stub is gated on the setting so no generated page ever links to a file that was not rendered. Wired the new field through CONFIG_SPECS (registry-driven defaults/validation/print-config/CLI override), the --details/--no-details CLI flags, usage() help, the verbose effective-config log, shuriken.json generation metadata, and the dry-run plan. DETAILS_PAGE=yes (the default) keeps prior output byte-for-byte identical. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diffstat (limited to 'src/lib/stats-filter-album.source.sh')
-rw-r--r--src/lib/stats-filter-album.source.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/stats-filter-album.source.sh b/src/lib/stats-filter-album.source.sh
index da37886..09dffb1 100644
--- a/src/lib/stats-filter-album.source.sh
+++ b/src/lib/stats-filter-album.source.sh
@@ -22,7 +22,9 @@
# within that filter. The "--<index>" suffix cannot collide with another gallery
# name because a pagebase never contains "--". All pages reuse the album's shared
# photos/thumbs/blurs assets (only the HTML differs); view pages link "Details"
-# to the album's own details page via the album_view_page_for_photo accessor.
+# to the album's own details page via the album_view_page_for_photo accessor,
+# but only when DETAILS_PAGE=yes actually rendered that page (see
+# _stats_build_filterview_body below).
# Pages render in
# parallel through the shared job pool, throttled to IMAGE_JOBS. The galleries
# reuse camera.tmpl and the view pages reuse cameraview.tmpl.
@@ -165,7 +167,11 @@ _stats_build_filterview_body() {
tooltip_attr=" title=\"$(html_escape "$tooltip")\""
fi
view_page=$(album_view_page_for_photo "$photo")
- if [ -n "$view_page" ]; then
+ # Only link to the album's details page when it was actually rendered
+ # (DETAILS_PAGE=yes); otherwise album_view_page_for_photo resolving a page
+ # would still point at a details file that render_photo_view_and_details
+ # never wrote, leaving a dangling link.
+ if [ -n "$view_page" ] && [ "$DETAILS_PAGE" = yes ]; then
details_link=$(printf \
' <a href="%s/%s-details.html">Details</a> <span class="nav-sep">|</span>' \
"$backhref_html" "$view_page")