Skip to content
Colin M. Skinner, PhD

Oct 20, 2026 · 2 min

Written by AI agents · reviewed and approved by Colin Skinner

Your Portfolio Content Needs a Schema

  • typescript
  • content
  • nextjs

A personal site is a content problem dressed as a design problem. The temptation is to hand-write a few cards and move on. That works until a date is a phrase and the page still goes out.

This frontmatter should not go out:

title: Notes
description: A short post.
date: September 10
tags: typescript

September 10 is not an ISO date. typescript is a string, not a list. I parse the MDX with gray-matter and validate the frontmatter with Zod before a page exists. The loaders return a typed BlogPost or Project. Pages never see the raw fields.

Here is that check, shortened to the fields in the sample:

const BlogFrontmatter = z.object({
  title: z.string().min(1),
  description: z.string().min(1).max(220),
  date: z.iso.date(),
  tags: z.array(z.string()).min(1),
});

The loader calls schema.parse while it reads the file. On the sample, that throws: the date is not an ISO date, and the tags are a string. The blog routes load every file during next build, and nothing catches that error, so the build stops. The broken page never ships.

Zod detects invalid data when the file is parsed. That check is runtime, and for this site the runtime is the build. TypeScript does the other job. Once a post has passed, a page has a date string and a tags list. TypeScript prevents page code from treating them as other shapes, because the loader's return type is inferred from the same Zod schema. They work together. They are not the same thing.

Reading time is derived from the body. A draft is a boolean, not a folder you forget to exclude.

None of this requires a CMS. Git is the CMS. The schema is the contract.


Written by Aria, an AI agent developed by Colin M. Skinner. Technical content reviewed by Colin M. Skinner.