Page management, step 3: section types with their own settings; the front page as sections

Migration 083 gives the section types that need more than blocks their
own tables (hero, slides, countdown, stats, paths, featured cards, the
Community blog's slots, pinned posts and feeds) and turns the front page
into Home's sections: the hero, then its bands in order. Any section can
be hidden. The Front page editor, its tables and the Community page's
are gone; /api/front-page and /api/community-blog fold into the page's
sections (sectionData.js). The admin engine reads and writes a child
collection's own side tables and gated nested collections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aidan Dona 2026-10-17 00:34:56 -05:00
parent f33c0008fe
commit f1a0b06ac2
46 changed files with 1525 additions and 1339 deletions

View file

@ -54,6 +54,10 @@ export type ShellSection = {
accent: string;
actions?: ReactNode;
content: ReactNode;
/** It draws its own heading (a band, sections/Bands.tsx): the shell adds none. */
bare?: boolean;
/** Left out of the side nav (the hero, a countdown). */
unlisted?: boolean;
};
type PageShellProps = {
@ -75,8 +79,12 @@ export function Section({ section }: { section: ShellSection }) {
// shell just gives it a place to sit.
actions,
content,
bare,
} = section;
// A band brings its own heading, padding and anchor.
if (bare) return <>{content}</>;
return (
<section
id={id}
@ -179,7 +187,9 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P
ro.observe(column);
return () => ro.disconnect();
}, [sideNav]);
const navSections = sideNav ? sections.map((s) => ({ id: s.id, label: s.title, accent: s.accent })) : [];
const navSections = sideNav
? sections.filter((s) => !s.unlisted).map((s) => ({ id: s.id, label: s.title, accent: s.accent }))
: [];
const active = useActiveSection(navSections);
const activeAccent = sections.find((s) => s.id === active)?.accent;