All articles
Engineering blog

Hello, world: how this blog is built

A first article that proves the whole chain end-to-end — MDX authoring, Shiki-highlighted code, reading-time, tags, and the paired worked-example repo callout.

Worked exampleTysoft-co/websiteRunnable, MIT-licensed extraction of the pattern in this article.

This is the first post on the Tysoft engineering blog. It exists to prove the pipeline works end to end before the real articles land — so it deliberately exercises every building block an article can use.

What an article is made of

Every post is an MDX file under src/content/blog/. The frontmatter is typed and validated at build time, so a missing title or a malformed publishDate fails the build with an actionable error instead of shipping broken.

Code blocks

Fenced code blocks get Shiki highlighting, a copy button, and an optional filename frame — just add a title:

src/content.config.ts
import { defineCollection, z } from 'astro:content';
import { glob } from 'astro/loaders';
const blog = defineCollection({
loader: glob({ pattern: '**/*.mdx', base: './src/content/blog' }),
schema: z.object({
title: z.string(),
publishDate: z.coerce.date(),
tags: z.array(z.string()).default([]),
}),
});
export const collections = { blog };

Inline code works too, and longer pieces get an automatic “On this page” table of contents from their headings.

The paired repo

Tool articles ship a standalone, MIT-licensed repo that extracts the pattern so you can use it without the surrounding product code:

Worked exampleTysoft-co/websiteThis site's own source — Astro + MDX + Expressive Code on GitHub Pages.

That’s the whole chain: authored in MDX, validated, highlighted, measured for reading-time, tagged, and linked to its worked example. The real articles start next.