Add a Featured Content section to the front page
Front page → Featured cards (migration 030) holds cards of three kinds: a record on the site, whose title, picture and link fill in from the record; a link, with a Fetch preview button that reads the page's title, description and preview image into the media library; and a video, drawn as a thumbnail that loads the player when pressed. A 'featured' section draws them. The cards are shared: featured_cards is owned polymorphically and FeaturedCards.tsx draws them, ready for the Community blog. Deleting a record removes its cards; an unpublished record's card is hidden. The preview fetch only goes to public http(s) addresses on standard ports, pinned to the vetted IP, with each redirect checked again. Along the way: repeater fields can show by another field's value (a hidden one is cleared), a CHECK named as a sentence is shown as the error, and the timeline's record list is now record_refs for both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
960c854611
commit
d4f65d93b4
17 changed files with 1140 additions and 50 deletions
|
|
@ -27,6 +27,7 @@ export type FrontPageSectionKey =
|
|||
| 'stats'
|
||||
| 'timeline'
|
||||
| 'connect'
|
||||
| 'featured'
|
||||
|
||||
export type HeroButton = { label: string; url: string }
|
||||
|
||||
|
|
@ -90,11 +91,26 @@ export type CountdownEvent = {
|
|||
series: EventSeries | null
|
||||
}
|
||||
|
||||
/** One featured card, as loadFeaturedCards in shape.js shapes it.
|
||||
* A record card's title and image are already its record's unless
|
||||
* the card overrides them; `ref` is what its link is built from. */
|
||||
export type FeaturedCard = {
|
||||
kind: 'record' | 'link' | 'video'
|
||||
ref: { kind: string; id: string; org_kind?: string | null } | null
|
||||
url: string | null
|
||||
eyebrow?: string | null
|
||||
title?: string | null
|
||||
blurb?: string | null
|
||||
/** Resolve with logoForKind in media.ts. */
|
||||
image: { file: string; kind: string } | null
|
||||
}
|
||||
|
||||
export type FrontPage = {
|
||||
hero: Hero
|
||||
sections: FrontPageSection[]
|
||||
stats: FrontPageStat[]
|
||||
paths: FrontPagePath[]
|
||||
featured: FeaturedCard[]
|
||||
countdown: CountdownEvent | null
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue