ShiftFast Docs

Content & Blog

How docs, blog, and legal pages are all powered by Fumadocs.

Docs, blog posts, and legal pages are all Fumadocs collections — the same underlying mechanism, configured once in source.config.ts:

export const docs = defineDocs({
  dir: 'content/docs',
  docs: {
    schema: pageSchema.extend({
      metaTitle: z.string().optional(),
    }),
  },
})

export const blog = defineCollections({
  type: 'doc',
  dir: 'content/blog',
  schema: pageSchema.extend({
    metaTitle: z.string().optional(),
    author: z.string(),
    date: z.string().date().or(z.date()),
    authorImage: z.string().optional(),
    image: z.string().optional(),
    tags: z.array(z.string()).optional(),
  }),
})

export const legal = defineCollections({
  type: 'doc',
  dir: 'content/legal',
  schema: pageSchema,
})

Each collection gets its own loader and baseUrl in src/lib/source.ts (docsSource → /docs, blogSource → /blog, legalSource → /legal), and its own route: (docs)/docs/[...slug], (marketing)/blog/[slug], (marketing)/legal/[slug].

  • docs uses defineDocs() with title/description plus an optional metaTitle. The sidebar order comes from meta.json (see Adding a doc page).
  • blog extends the base page schema with author, date, and optional metaTitle, authorImage, image, tags. Posts are listed newest first by date. There's no meta.json category structure for blog posts — every .mdx file under content/blog/ is just a flat post.
  • legal uses the plain base schema — it's how Terms and Privacy are authored as MDX instead of hardcoded JSX.

Adding a doc page

Create a new file under content/docs/, e.g. content/docs/my-page.mdx, with title and description frontmatter. It's available at /docs/my-page.

To place it in the sidebar, add its filename (without .mdx) to the pages array in content/docs/meta.json. Entries like "---Core---" are section headings. A subfolder with its own meta.json becomes a collapsible group, and its index.mdx is the group's landing page.

Adding a blog post

Create a new file directly under content/blog/, e.g. content/blog/my-post.mdx:

---
title: My Post Title
description: One-sentence summary for the listing page and meta description.
author: Jane Doe
date: 2026-01-15
tags: [product, updates]
---

Post content here.

It appears automatically at /blog/my-post and in the sitemap — no route file or meta.json entry needed. Its frontmatter also becomes the post's structured data, via buildArticleJsonLd() (see SEO & Metadata). An author that starts with your SITE_NAME (like "ShiftFast Team") is marked up as your organization; any other name is marked up as a person.

Search titles

The title is the page heading and, in docs, the sidebar label. To show a different, usually shorter or more descriptive, title in search results and the browser tab, add metaTitle to the frontmatter of any docs page or blog post:

---
title: Authentication
metaTitle: Next.js Authentication with Clerk
description: How Clerk handles sign-in, sign-up, and route protection.
---

Keep it under about 60 characters, which is roughly what search results show.

On this page