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 namecategory— post category stringseries/seriesOrder— for multi-part seriescanonical— canonical URL override
page
Matched by pages/**/*.md. URL prefix: /.
Additional front matter fields:
order— sort order in navigationshowInNav— include insite.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/.