mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
5188f5b003
Serves `content/docs/v5` and `content/worlds/v5` unprefixed at /docs, /worlds and /cookbook, moves v4 under /v4, and puts What's new first in the v5 sidebar. The versioned source config drives both route trees (the root tree always renders `versionedSources.current`), so this is a `routePrefix` move plus source re-binding rather than a restructure. The only file moves are `app/[lang]/v5/**` → `app/[lang]/v4/**`. - Version switcher: `v5 (Latest)` / `v4 (Maintenance)`, `current: 'v5'`. - `pre-release-banner.tsx` becomes `maintenance-banner.tsx`. v4 pages carry an amber notice whose "Go to Workflow 5 (Latest)" link deep-links to the same page on the current version, falling back to the nearest section index for v4-only pages, and keep `robots: noindex, follow`. - Redirects: `/v5/*` to the unprefixed equivalent (bare `/v5` needs its own rule, since `:path*` expands to an empty Location). The world-docs and api-reference restructure rules are mirrored onto `/v4/docs/*`, and every page existing in only one tree gets a version-switcher fallback. - Both worlds route trees pass an explicit version into the shared page components, whose semantics flipped with the switch, so the smoke checks now assert the pairing: a " · v4" title marker and noindex on the maintenance routes, neither on the canonical ones, and a community world serving directly rather than self-redirecting. - The link lint's two URL spaces swap with the prefixes. Redirect destinations resolve against the real HTTP space, since redirects are matched before render-time href rewriting. - The two `/v4/...` links this makes expressible are restored: a v5 page cannot link to a v4 page while v4 is the unprefixed version. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
75 lines
1.8 KiB
TypeScript
75 lines
1.8 KiB
TypeScript
import {
|
|
defineGeistdocsSourceConfig,
|
|
geistdocsFrontmatterSchema,
|
|
geistdocsMetaSchema,
|
|
} from '@vercel/geistdocs/source-config';
|
|
import { defineDocs } from 'fumadocs-mdx/config';
|
|
import { z } from 'zod';
|
|
|
|
// You can customise Zod schemas for frontmatter and `meta.json` here
|
|
// see https://fumadocs.dev/docs/mdx/collections
|
|
const docsSchema = geistdocsFrontmatterSchema.extend({
|
|
// Opt a section landing page out of the card↔nav completeness lint when its
|
|
// `<Cards>` grid is intentionally curated (e.g. links outside the section or
|
|
// deliberately omits children). Exhaustive list pages should use `<AutoCards />`
|
|
// instead, which derives cards from the page tree and can never drift.
|
|
manualCards: z.boolean().optional(),
|
|
});
|
|
|
|
export const v4docs = defineDocs({
|
|
dir: 'content/docs/v4',
|
|
docs: {
|
|
schema: docsSchema,
|
|
postprocess: {
|
|
includeProcessedMarkdown: true,
|
|
},
|
|
},
|
|
meta: {
|
|
schema: geistdocsMetaSchema,
|
|
},
|
|
});
|
|
|
|
export const v5docs = defineDocs({
|
|
dir: 'content/docs/v5',
|
|
docs: {
|
|
schema: docsSchema,
|
|
postprocess: {
|
|
includeProcessedMarkdown: true,
|
|
},
|
|
},
|
|
meta: {
|
|
schema: geistdocsMetaSchema,
|
|
},
|
|
});
|
|
|
|
// Canonical World docs rendered at /worlds/* (v5/current) and /v4/worlds/*
|
|
// (the docs trees only keep the Deploying overview; world pages live outside
|
|
// the docs, versioned with the same v4/v5 strategy).
|
|
export const worldsV4Docs = defineDocs({
|
|
dir: 'content/worlds/v4',
|
|
docs: {
|
|
schema: docsSchema,
|
|
postprocess: {
|
|
includeProcessedMarkdown: true,
|
|
},
|
|
},
|
|
meta: {
|
|
schema: geistdocsMetaSchema,
|
|
},
|
|
});
|
|
|
|
export const worldsV5Docs = defineDocs({
|
|
dir: 'content/worlds/v5',
|
|
docs: {
|
|
schema: docsSchema,
|
|
postprocess: {
|
|
includeProcessedMarkdown: true,
|
|
},
|
|
},
|
|
meta: {
|
|
schema: geistdocsMetaSchema,
|
|
},
|
|
});
|
|
|
|
export default defineGeistdocsSourceConfig();
|