Add a blog: posts at /blog/:id and a Community page section

Admin → Blog → Posts (migration 031): our own posts with a
content-block body, cover image, excerpt, date, tags, and authors
shown as person tiles, either People records or a guest name and
photo. A post is a draft until published; Listed works as it does
elsewhere. Posts are on the QR page too.

Admin → Blog → Community section: the first section of the
Community page, with its heading and blurb from the admin, in two
halves, each pinned first and then newest up to its slots. Our posts
come from blog_posts; community posts are pinned link or video cards
(reusing featured cards and Fetch preview), then the newest items
from a list of RSS or Atom feeds. Feeds are read through the link
preview's guarded fetch and cached for 30 minutes, and a failing feed
keeps its last good items.

content_blocks and featured_cards are rebuilt to accept the new owner
kinds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-27 16:27:00 -05:00
parent d4f65d93b4
commit d374f9ac17
21 changed files with 1275 additions and 15 deletions

View file

@ -24,7 +24,7 @@ import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
import QrCode from '../../components/QrCode.tsx'
import { NAV_ACTIONS, PAGE_LINKS, PAGE_SECTIONS } from '../../navConfig.ts'
import { awardHref, eventHref, orgHref, personHref, teamHref } from '../../lib/hrefs.ts'
import { awardHref, blogHref, eventHref, orgHref, personHref, teamHref } from '../../lib/hrefs.ts'
import { siteUrl } from '../../lib/site.ts'
import { useDirectory, type Directory } from '../../lib/useContent.ts'
@ -35,7 +35,7 @@ const MUTED = '#4a6b72'
anything bigger should use the SVG. */
const PNG_SIZE = 1024
type Kind = 'pages' | 'events' | 'organizations' | 'teams' | 'awards' | 'people'
type Kind = 'pages' | 'events' | 'organizations' | 'teams' | 'awards' | 'people' | 'blog_posts'
const KINDS: Array<[Kind, string]> = [
['pages', 'Main navigation'],
@ -44,6 +44,7 @@ const KINDS: Array<[Kind, string]> = [
['teams', 'Teams'],
['awards', 'Awards'],
['people', 'People'],
['blog_posts', 'Blog posts'],
]
/* Organizations are grouped by kind in the dropdown, in this order. */
@ -106,6 +107,8 @@ function groupsFor(kind: Kind, directory: Directory | null): Group[] {
return [{ choices: directory.awards.map((a) => ({ path: awardHref(a.id), label: a.name })) }]
case 'people':
return [{ choices: directory.people.map((p) => ({ path: personHref(p.id), label: p.name })) }]
case 'blog_posts':
return [{ choices: directory.blog_posts.map((b) => ({ path: blogHref(b.id), label: b.name })) }]
}
}