summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-14 23:07:12 +0300
committerPaul Buetow <paul@buetow.org>2026-06-14 23:07:12 +0300
commitb7d5c1102c3679b67532f30f2613e4d2d61c59ba (patch)
tree573548dc8762aeb7c642fed804894d280425f84c /share
parent0f0662850ad2df3502241cd1bdfcb366dd68d717 (diff)
rm0 wire stats feature into generate with STATS_PAGE toggle
Final integration of the stats-site feature: - Add STATS_PAGE config (default yes) mirroring SPLASH_PAGE through every layer: shuriken.default.conf, apply_config_defaults, CLI_OPTION_SPEC (--stats/--no-stats), the CLI_CONFIG_OVERRIDE_TARGETS allowlist (without which the flag was silently ignored), usage text, yes/no validation, print_config, the action config list + effective-setting log, the generation metadata, and the dry-run plan. - generate() now calls a gated generate_stats_pages helper after the album pages (and before archiving, so the stats/camera pages are tarballed): collect_photo_exif_stats + render_stats_page . . + render_camera_pages . . - Emit "stats_page" in shuriken.json next to "splash_page". - Gate the header Stats nav link behind STATS_PAGE via a new render_stats_page_html config_html field, so it is hidden (no 404) when stats are disabled. - Document STATS_PAGE and --stats/--no-stats in the README. - Tests: full --generate produces stats.html + camera-<slug>.html + the nav link and stats_page=true; --no-stats suppresses all three and sets stats_page=false; print-config and metadata expectations updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'share')
-rw-r--r--share/templates/default/header.tmpl8
1 files changed, 8 insertions, 0 deletions
diff --git a/share/templates/default/header.tmpl b/share/templates/default/header.tmpl
index e0acc6f..6a163f9 100644
--- a/share/templates/default/header.tmpl
+++ b/share/templates/default/header.tmpl
@@ -276,8 +276,16 @@ cat <<END
Site generated at ${render_current_date_text} with <a href="https://codeberg.org/snonux/shuriken.sh">codeberg.org/snonux/shuriken.sh</a>
-
&copy; by Paul Buetow
+END
+# The Stats nav link is only shown when the stats page was actually generated
+# (STATS_PAGE=yes); otherwise it would point at a missing stats.html.
+if [ "${render_stats_page_html}" = 'yes' ]; then
+cat <<END
-
<a href="${render_backhref_html}/stats.html">Stats</a>
+END
+fi
+cat <<END
</div>
END
fi