mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
6fad87b2a4
Section index card grids (e.g. foundations) were hand-written and drifted from the sidebar (meta.json) and the actual pages. Make them derive from the fumadocs page tree (single source of truth) and add CI lint so the card grid and navigation can't fall out of sync again. - resolveSectionChildren + <AutoCards/>, bound in both v4 and v5 docs routes (correct /docs vs /v5/docs URL spaces) - getLLMText expands <AutoCards/> so llms.txt/.md/copy-page keep child links - manualCards frontmatter opt-out for curated pages (source.config.ts) - checkSectionCards (card<->nav completeness) + checkMetaEntriesResolve (dangling meta entries) in scripts/lint.ts - convert foundations + errors (drift fixes) and v5 observability to AutoCards - mark deploying + ai as manualCards (intentionally curated) - remove dangling meta entries: v4 cancellation (x2), root introduction (x2), v4/internal serializable-abort-controller Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
28 lines
889 B
TypeScript
28 lines
889 B
TypeScript
import { Card, Cards } from 'fumadocs-ui/components/card';
|
|
import type { SectionChild } from '@/lib/geistdocs/section-children';
|
|
|
|
/**
|
|
* Renders a card grid for a section landing page from children resolved off the
|
|
* fumadocs page tree (see `resolveSectionChildren`). Because the list is derived
|
|
* from `meta.json` + page frontmatter rather than hand-written, the cards can
|
|
* never drift from the sidebar navigation.
|
|
*
|
|
* The `items` are bound per-request in the docs route handlers, where the active
|
|
* version's page tree and the current page URL are known.
|
|
*/
|
|
export function AutoCards({ items }: { items: SectionChild[] }) {
|
|
return (
|
|
<Cards>
|
|
{items.map((item) => (
|
|
<Card
|
|
key={item.url}
|
|
href={item.url}
|
|
title={item.title}
|
|
description={item.description}
|
|
icon={item.icon}
|
|
/>
|
|
))}
|
|
</Cards>
|
|
);
|
|
}
|