site: hero auto-discovery, pick.json hero selection, amazonLink + shortlist fields

- src/lib/hero.ts: review heroes are now auto-discovered via import.meta.glob
  over reviews/*/hero.<ext>; only legacy non-hero-named assets remain as
  explicit overrides. New reviews need zero registration.
- Pick of the day moves from a hardcoded HERO_SLUG in index.astro to
  src/data/pick.json (content edit, not code edit); dev set-pick API and
  the review-page button now write pick.json. Fallback: latest review.
- Schemas: finds gain shortlist (bool) + amazonLink; reviews gain amazonLink.
- Review + find pages render an 'Also on Amazon' affiliate link when
  amazonLink is set, with shared disclosure handling.
- Both hero globs now include .avif (two June finds ship avif heroes).
This commit is contained in:
2026-07-03 15:16:25 -04:00
parent 5a4de71ad4
commit 80b3920715
8 changed files with 86 additions and 53 deletions
+3
View File
@@ -21,6 +21,7 @@ const reviews = defineCollection({
tags: z.array(z.string()).default([]),
link: z.string().url().optional(),
linkText: z.string().optional(),
amazonLink: z.string().url().optional(),
description: z.string().optional(),
source: z.string().optional(),
fromFind: z.string().optional(),
@@ -54,11 +55,13 @@ const find = defineCollection({
date: z.coerce.date(),
link: z.string().url(),
linkText: z.string().optional(),
amazonLink: z.string().url().optional(),
source: z.string(),
topics: z.array(z.string()).default([]),
tags: z.array(z.string()).default([]),
description: z.string().optional(),
promotedTo: z.string().optional(),
shortlist: z.boolean().default(false),
editorialTags: z.array(z.string()).default([]),
}),
});