Stedefast

Content

Content Types

1 min read

Content types define the shape of your front matter and the URL structure for a group of files.

Built-in types

post

Matched by posts/**/*.md. URL prefix: /posts/.

Additional front matter fields:

  • author — post author name
  • category — post category string
  • series / seriesOrder — for multi-part series
  • canonical — canonical URL override

page

Matched by pages/**/*.md. URL prefix: /.

Additional front matter fields:

  • order — sort order in navigation
  • showInNav — include in site.nav (default: false)
  • parentSlug — for hierarchical page trees

Custom content types

Register custom types in stedefast.config.ts:

import { z } from "zod";

export default defineConfig({
  contentTypes: [
    {
      name: "project",
      schema: z.object({
        title: z.string(),
        tagline: z.string().optional(),
        url: z.string().url().optional(),
        repo: z.string().url().optional(),
        featured: z.boolean().default(false),
        technologies: z.array(z.string()).default([]),
        status: z.enum(["active", "archived", "wip"]).default("active"),
      }),
      pattern: "projects/**/*.md",
      defaultTemplate: "project",
      urlPrefix: "/projects/",
      sortBy: "date",
      sortOrder: "desc",
    },
  ],
});

Content files then go in content/projects/.