1
0

source.config.ts 874 B

123456789101112131415161718192021222324252627282930
  1. import { defineConfig, defineDocs } from 'fumadocs-mdx/config';
  2. import { metaSchema, pageSchema } from 'fumadocs-core/source/schema';
  3. import { z } from 'zod';
  4. // `title` is already required by `pageSchema`. We additionally require a
  5. // non-empty `description` on every page (used for SEO, search, and OG images),
  6. // so the build fails fast if a page is missing it.
  7. // See https://fumadocs.dev/docs/mdx/collections
  8. export const docs = defineDocs({
  9. dir: 'content/docs',
  10. docs: {
  11. schema: pageSchema.extend({
  12. description: z
  13. .string({ message: 'Every doc page needs a frontmatter `description`.' })
  14. .min(1, 'Frontmatter `description` cannot be empty.'),
  15. }),
  16. postprocess: {
  17. includeProcessedMarkdown: true,
  18. },
  19. },
  20. meta: {
  21. schema: metaSchema,
  22. },
  23. });
  24. export default defineConfig({
  25. mdxOptions: {
  26. // MDX options
  27. },
  28. });