feat: image variants job and variants in the post API

- golem15_journal_image_variants (migration 202610280002): a thumbnail
  per width of golem15.journal.image_widths (480, 800, 1200 by default,
  never wider than the original) and its WebP copy, with the original's
  size
- conga job golem15.journal.image_variants (three attempts), queued after
  a featured image upload and after an admin save of a post whose images
  lack a width; the upload request never encodes
- journal:image-variants [--all] backfills
- featured_images[].variants {width, height, url, webp_url, source_width,
  source_height} on the post answers (additive key)
This commit is contained in:
Jakub Zych
2026-11-04 17:05:16 +01:00
parent ee3cb263dc
commit 4f5bd190e5
13 changed files with 784 additions and 5 deletions

View File

@@ -264,6 +264,9 @@ func (c postsAdminController) afterPostWrite(ctx context.Context, model any) err
if post, ok := model.(*models.Post); ok && post != nil {
purger, tx := siteCachePurger(ctx, c.app)
classes.PurgeSiteCacheAfterCommit(ctx, tx, purger, "post", post.Slug)
// Featured images uploaded in the form are bound by this save;
// their variants are queued once it commits (D-85).
classes.DispatchPostImageVariantsAfterCommit(ctx, tx, c.application(), post.ID)
}
return nil
}