Files
Pranay Prakash 6fad87b2a4 docs: derive section landing-page cards from the page tree + lint drift (#2567)
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>
2026-06-22 14:37:35 -07:00

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>
);
}