mirror of
https://github.com/tale/headplane.git
synced 2026-10-26 22:47:55 +00:00
32 lines
787 B
TypeScript
32 lines
787 B
TypeScript
import { loader } from "fumadocs-core/source";
|
|
import { pageSchema } from "fumadocs-core/source/schema";
|
|
import { defineCollections, defineDocs } from "fumadocs-mdx/macro";
|
|
|
|
// Pages lead with their own `# Heading`, which doubles as the title when the
|
|
// frontmatter doesn't set one.
|
|
export const docs = defineDocs({
|
|
dir: ".",
|
|
docs: {
|
|
files: ["**/*.{md,mdx}"],
|
|
async: true,
|
|
schema: ({ path, source }) =>
|
|
pageSchema.extend({
|
|
title: pageSchema.shape.title.default(/^# (.+)$/m.exec(source)?.[1] ?? path),
|
|
}),
|
|
},
|
|
meta: {
|
|
files: ["**/meta.json"],
|
|
},
|
|
});
|
|
|
|
export const source = loader({
|
|
source: docs.toFumadocsSource(),
|
|
baseUrl: "/",
|
|
});
|
|
|
|
export const changelog = defineCollections({
|
|
type: "doc",
|
|
dir: "..",
|
|
files: ["CHANGELOG.md"],
|
|
});
|