mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-21 05:50:55 +08:00
docs/content/docs/limitations.mdx now holds the frontmatter, the headings, the anchor spans and one <include> line per partial. The text moves unchanged to docs/content/limitations/: one file per labeled bullet (<section>/<label>.mdx) and one per section's other text (<section>.mdx). Edits to different bullets no longer touch adjacent lines of one file. remarkDocsConventions splices the included partials into the page and joins the lists that consecutive bullet partials contribute, so the page, its Markdown twin and the search index render as before. The route tests read the page with its partials inlined. A page that includes partials takes its last-modified date, used by the sitemap, from the newest commit to the page or any of its partials. docs/scripts/limitations-partials.mjs joins the partials back into one file, splits a single-file page, and merges a branch's edits to the single-file page into the partials.
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import {
|
|
defineGeistdocsSourceConfig,
|
|
geistdocsFrontmatterSchema,
|
|
geistdocsMetaSchema,
|
|
} from "@vercel/geistdocs/source-config";
|
|
import { defineDocs, type DefaultMDXOptions } from "fumadocs-mdx/config";
|
|
import { partialsLastModified } from "./src/lib/partials-last-modified";
|
|
import { headingId, remarkDocsConventions } from "./src/lib/remark-docs";
|
|
import { docsShikiTheme } from "./src/lib/shiki-theme";
|
|
|
|
export const docs = defineDocs({
|
|
dir: "content/docs",
|
|
docs: {
|
|
schema: geistdocsFrontmatterSchema,
|
|
postprocess: { includeProcessedMarkdown: true },
|
|
},
|
|
meta: { schema: geistdocsMetaSchema },
|
|
});
|
|
|
|
const config = defineGeistdocsSourceConfig({
|
|
plugins: [partialsLastModified()],
|
|
mdxOptions: {
|
|
remarkHeadingOptions: { slug: (_root, _heading, text) => headingId(text) },
|
|
remarkPlugins: [remarkDocsConventions],
|
|
remarkStructureOptions: {
|
|
types: ["heading", "paragraph", "blockquote", "tableCell", "mdxJsxFlowElement", "mdxJsxTextElement", "text", "inlineCode", "code"],
|
|
},
|
|
},
|
|
});
|
|
const mdxOptions = config.mdxOptions as DefaultMDXOptions;
|
|
|
|
export default {
|
|
...config,
|
|
mdxOptions: {
|
|
...mdxOptions,
|
|
rehypeCodeOptions: {
|
|
...mdxOptions.rehypeCodeOptions,
|
|
themes: { light: docsShikiTheme, dark: docsShikiTheme },
|
|
},
|
|
},
|
|
};
|