Summary
Phases 1, 2, and 4 (PR #32) added pre-commit hooks for image compression, a size cap, and code quality. There is no hook that verifies image references resolve. The dibs-web01 rot (separate issue) is exactly the failure mode this would catch.
Proposal
A small Python script run as a local hook in .pre-commit-config.yaml:
- For each staged
*.html and *.md, scan for <img src="..."> and  references.
- For relative paths: verify the target exists in the repo.
- For external URLs: HEAD with a short timeout; fail on 4xx/5xx (with the same conservative accept list as lychee).
- Skip data URIs and template Liquid expressions like
{{ site.url }}/....
Mirror in CI so contributors who skip the local install still get caught.
Acceptance
Pairs with
The dibs-web01 migration issue. This hook is the prevention; that one is the cure.
Summary
Phases 1, 2, and 4 (PR #32) added pre-commit hooks for image compression, a size cap, and code quality. There is no hook that verifies image references resolve. The dibs-web01 rot (separate issue) is exactly the failure mode this would catch.
Proposal
A small Python script run as a
localhook in.pre-commit-config.yaml:*.htmland*.md, scan for<img src="...">andreferences.{{ site.url }}/....Mirror in CI so contributors who skip the local install still get caught.
Acceptance
scripts/check_image_refs.py(stdlib + minimal deps).pre-commit-config.yaml.github/workflows/pre-commit.ymland/orsite-health.yml.image-size-overrides)Pairs with
The dibs-web01 migration issue. This hook is the prevention; that one is the cure.