Stedefast

Getting Started

Config Reference

2 min read

All site configuration lives in stedefast.config.ts at the root of your project.

Required fields

Field Type Description
siteTitle string Site display title, used in <title> and RSS
baseUrl string Canonical base URL, e.g. https://myblog.com
contentDir string Path to content directory, relative to config file
outputDir string Path to build output, relative to config file
theme string Path to theme directory, relative to config file

Optional fields

Field Type Default Description
siteDescription string Site description, used in RSS and meta tags
publicDir string ./public Directory copied verbatim to dist/
modules StedefastModule[] [] Dynamic modules (comments, claps, analytics)
plugins StedefastPlugin[] [] Build-time Markdown pipeline plugins (syntax highlighting, etc.)
contentTypes ContentTypeDefinition[] [] Custom content type schemas
collections CollectionDefinition[] [] Named content collections with optional pagination
templateEngines ("react" | "liquid")[] ["react", "liquid"] Template engine priority order
defaults Record<string, unknown> {} Default front matter values for all content
tailwindConfig string Path to Tailwind config file
cloudflare CloudflareConfig Cloudflare deployment settings

Cloudflare config

cloudflare: {
  projectName: "my-site",           // Cloudflare Pages project name
  accountId: "...",                  // Optional — falls back to CLOUDFLARE_ACCOUNT_ID env var
  d1Databases: [
    { binding: "DB", databaseId: "..." }
  ],
  kvNamespaces: [
    { binding: "CLAPS_KV", namespaceId: "..." }
  ],
  r2Buckets: [
    { binding: "STATIC_R2", bucketName: "my-site-static" }
  ],
}

Example: full config with modules

import { defineConfig } from "@stedefast/core";
import { ShikiPlugin } from "/plugin-shiki";
import { CommentsModule } from "@stedefast/module-comments";
import { ClapsModule } from "@stedefast/module-claps";

export default defineConfig({
  siteTitle: "My Blog",
  siteDescription: "A blog built with Stedefast.",
  baseUrl: "https://myblog.com",
  contentDir: "./content",
  outputDir: "./dist",
  theme: "./theme",
  plugins: [
    ShikiPlugin({ themes: { light: "github-light", dark: "github-dark" } }),
  ],
  modules: [
    CommentsModule({ requireApproval: true }),
    ClapsModule(),
  ],
  collections: [
    {
      name: "posts",
      types: ["post"],
      paginate: { perPage: 10 },
    },
  ],
  cloudflare: {
    projectName: "my-blog",
    d1Databases: [{ binding: "DB", databaseId: "YOUR_D1_ID" }],
    kvNamespaces: [{ binding: "CLAPS_KV", namespaceId: "YOUR_KV_ID" }],
  },
});