Skip to content

feat(standard-site): add document coverImage from blog header#9

Merged
fmalcher merged 1 commit into
mainfrom
feat/document-cover-image
Jul 22, 2026
Merged

feat(standard-site): add document coverImage from blog header#9
fmalcher merged 1 commit into
mainfrom
feat/document-cover-image

Conversation

@fmalcher

Copy link
Copy Markdown
Member

What

Uploads each blog post's optimized header image as the coverImage blob on its site.standard.document record, so posts carry a thumbnail/cover in the standard.site / AT Protocol network.

How

  • DocumentSource gains an optional distDir so the publisher can locate the built, WebP-optimized header at dist/<contentType>/<slug>/<header.url>.
  • build.ts passes distDir for the blog source. Material chapters have no headers → source omits distDir, no cover uploaded.
  • Per document: read header bytes → uploadBlob → set record.coverImage.
  • coverImage is content-addressed, so re-runs with an unchanged image reuse the same CID (idempotent, matches the existing rkey-stable upsert model).

Safety

  • Non-fatal per document: a missing, unsupported (e.g. .gif/video header), or oversized (>1MB, per the lexicon guidance) image warns and is skipped — never throws. Publishing already runs inside a non-fatal try/catch with transient-retry.
  • Dry-run (STANDARD_SITE_DRY_RUN=true) logs the intended cover upload without calling the PDS.

Verification

  • tsc --noEmit clean; full test suite green (262 tests).

Docs updated in STANDARD-SITE.md. Rolls out to both consuming sites via a follow-up submodule bump.

@fmalcher
fmalcher merged commit a40aff6 into main Jul 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant