Documentation
Learn how to write documentation in the monorepo.
The documentation uses Content Collections, a markdown-based CMS. All content is written and styled using .mdx files. It's markdown combined with React components.
Why choose Content Collections? This is a great alternative to headless CMS platforms such as Contentful or Prismic and is powered by MDX. It’s free, open-source and saves content directly in your repository.
When content changes, you need to redeploy the marketing app because the pages are statically compiled and not dynamically fetched from a database.
Add a new documentation page
To create a new page, follow these steps:
-
Create a new file Navigate to the
/apps/marketing/content/docsdirectory and create a new.mdxfile. The file name will act as the URL slug for the post. For example:- File name:
hello-world.mdx - URL:
https://your-app.com/docs/hello-world
- File name:
-
Add metadata At the top of the
.mdxfile, include a frontmatter block. This block contains key metadata about your docs, written in a YAML-like format enclosed by three dashes (---). Here's an example:
---
title: Hello World
description: This is my first documentation page.
---Link the new documentation page
Add the last item to DOCS_LINKS inside apps/marketing/components/marketing-links.tsx.
{
title: 'Guides',
icon: <BookIcon className="size-4 shrink-0 text-muted-foreground" />,
items: [
{
title: 'Introduction',
href: '/docs',
items: []
},
{
title: 'Dependencies',
href: '/docs/dependencies',
items: []
},
// [\!code highlight:5]
{
title: 'Hello World',
href: '/docs/hello-world',
items: []
}
]
}Your docs are automatically added to the search.