Schema Reference

Complete reference for the blog.json file structure. All fields are optional unless marked as required.

Root Structure

{
  "site": { ... },      // Site metadata (required)
  "basics": { ... },    // Author information
  "posts": [ ... ],     // Blog posts
  "pages": [ ... ]      // Static pages
}

site (required)

Core website metadata.

FieldTypeDescription
titlestringYour blog's title
descriptionstringBrief description for meta tags
urlstringFull URL (e.g., https://blog.example.com)

basics

Information about the author.

FieldTypeDescription
namestringAuthor's name
emailstringContact email
urlstringPersonal website or portfolio

posts

Array of blog post objects.

FieldTypeDescription
titlestringPost title
contentstringMarkdown content
descriptionstringShort summary for listings
createdAtstringDate in YYYY-MM-DD format
updatedAtstringLast updated date
tagsstring[]Array of tag names
categoriesstring[]Array of category names
type'ai' | 'human'Mark AI-generated posts
slugstringCustom URL slug (auto-generated if omitted)
{
  "posts": [
    {
      "title": "My First Post",
      "content": "# Hello\n\nThis is my first post!",
      "description": "An introduction to my blog",
      "createdAt": "2025-01-20",
      "tags": ["intro", "welcome"],
      "categories": ["Meta"],
      "type": "human"
    }
  ]
}

pages

Array of static page objects (About, Contact, etc.).

FieldTypeDescription
titlestringPage title
contentstringMarkdown content
slugstringCustom URL slug (auto-generated if omitted)

Complete Example

{
  "site": {
    "title": "Jane's Dev Blog",
    "description": "Thoughts on web development and design",
    "url": "https://janedoe.dev"
  },
  "basics": {
    "name": "Jane Doe",
    "email": "jane@example.com",
    "url": "https://janedoe.com"
  },
  "posts": [
    {
      "title": "Building with TypeScript",
      "content": "# TypeScript Best Practices\n\n...",
      "description": "Tips for writing better TypeScript",
      "createdAt": "2025-01-15",
      "tags": ["typescript", "javascript"],
      "categories": ["Development"]
    },
    {
      "title": "AI-Generated Weekly Summary",
      "content": "# This Week in Tech\n\n...",
      "type": "ai",
      "createdAt": "2025-01-20"
    }
  ],
  "pages": [
    {
      "title": "About",
      "content": "# About Me\n\nI'm a web developer..."
    }
  ]
}

Validation

The @jsonblog/schema package provides validation using JSON Schema and Zod.

npm install @jsonblog/schema