diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-27 22:43:42 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-27 22:43:42 +0300 |
| commit | 2a79fd67e8a29e4e37cda38acd9390c5f4594dc2 (patch) | |
| tree | cee8e472abb3db6b6451f7d3fed83fad7c652b3d /src/lib/generation-metadata.source.sh | |
| parent | 75925e88fe6f15519490d37e79c93eaa2a3b12aa (diff) | |
rr0: data-driven config_html via indirect expansion of source_name
Replace the hardcoded per-name case in
prepare_template_render_var__config_html (HEIGHT/MAXPREVIEWS/
ORIGINAL_BASEPATH/SOURCE_URL/STATS_PAGE/THUMBHEIGHT/TITLE) with a single
indirect read of the spec's source_name: context_value=${!source_name-}.
The handler is now fully data-driven and never needs editing when a new
config render-var is added (Open/Closed), matching the module's
spec-driven dispatch. source_name is already passed to every handler by
prepare_template_render_vars, so no dispatch contract changed.
Output is byte-identical for all reachable states: apply_config_defaults
always runs before render (HEIGHT/ORIGINAL_BASEPATH/SOURCE_URL/STATS_PAGE/
TITLE always set, so the old defensive :- fallbacks like STATS_PAGE :-no
were unreachable), and the unset-safe '-' default reproduces the empty
result for refresh-only MAXPREVIEWS/THUMBHEIGHT.
Dropping the literal ${TITLE:-} re-surfaced a previously-suppressed
SC2153 on $TITLE in generation-metadata.source.sh (lowercase 'title'
locals in the stats modules); add a targeted shellcheck disable there.
Regenerated bin/shuriken. just test/shellcheck/check-generated all green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'src/lib/generation-metadata.source.sh')
| -rw-r--r-- | src/lib/generation-metadata.source.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/generation-metadata.source.sh b/src/lib/generation-metadata.source.sh index 931bd92..dc3578a 100644 --- a/src/lib/generation-metadata.source.sh +++ b/src/lib/generation-metadata.source.sh @@ -29,6 +29,11 @@ _collect_generation_metadata() { ) _GENERATION_METADATA["tarball_included"]="$TARBALL_INCLUDE" _GENERATION_METADATA["tarball_file"]="$tarball_file" + # SC2153: a lowercase "title" local in the --check-sourced stats modules + # makes shellcheck suspect $TITLE is a misspelling. The config global is + # correct here; the suppression used to ride on a literal ${TITLE:-} in + # template.source.sh, which is now an indirect expansion, so disable it here. + # shellcheck disable=SC2153 _GENERATION_METADATA["settings_title"]="$TITLE" _GENERATION_METADATA["settings_height"]="$HEIGHT" _GENERATION_METADATA["settings_thumbheight"]="$THUMBHEIGHT" |
