diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-15 23:36:14 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-15 23:50:41 +0300 |
| commit | 72d24e3b13560f94bdcfd986fda47b20f0ad4227 (patch) | |
| tree | 1e8b7e8e733214b0ed151e4bf7478ce20c9dccdb /src/lib/config.validate.source.sh | |
| parent | 06b910863906faa5f01d7f7067cdbaa8af89dfba (diff) | |
Make the favicon configurable via FAVICON config / --favicon flag
The generated pages link a favicon.ico that was always the bundled shuriken
favicon (copy_site_favicon hard-copied share/shuriken/assets/favicon.ico). Add a
FAVICON config variable and a --favicon PATH CLI flag: when set, that file is
published as favicon.ico instead of the bundled default; when empty, the bundled
favicon is used as before.
Plumbed through apply_config_defaults, CLI_OPTION_SPEC + override allowlist,
usage, print_config, the action config list and effective-setting log, and
validated (a non-empty FAVICON must be a readable file) before generation.
shuriken.default.conf and the README document it; a test covers a custom favicon,
its appearance in --print-config, and rejection of a missing file.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'src/lib/config.validate.source.sh')
| -rw-r--r-- | src/lib/config.validate.source.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/config.validate.source.sh b/src/lib/config.validate.source.sh index bd2fccf..fda20f0 100644 --- a/src/lib/config.validate.source.sh +++ b/src/lib/config.validate.source.sh @@ -195,6 +195,19 @@ validate_common_config() { validate_yes_no_config_var SPLASH_PAGE || return validate_yes_no_config_var STATS_PAGE || return validate_yes_no_config_var TARBALL_INCLUDE || return + validate_favicon_config || return +} + +# A custom FAVICON (when set) must be a readable file; empty means the bundled +# default favicon is used. +validate_favicon_config() { + if [ -z "${FAVICON:-}" ]; then + return + fi + if [ ! -f "$FAVICON" ] || [ ! -r "$FAVICON" ]; then + config_error "FAVICON file $FAVICON must be a readable file" + return 1 + fi } validate_generation_config() { |
