In an effort to code-in-the-open, we’re kicking off this changelog by describing…this changelog.
We use Astro for Gaffer’s marketing site and documentation site. It’s fast, simple and easy to use. Deploying the artifacts to Cloudflare Pages has also been easy.
Astro’s content collections API manages structured content. It’s a great way to manage blog posts and documentation. Creating a content collection for MDX changelog entries was as easy adding this ./src/content.config.ts
file:
import { glob } from 'astro/loaders';
import { defineCollection, z } from 'astro:content';
const changelog = defineCollection({
loader: glob({ pattern: '**/*.mdx', base: './src/changelog' }),
schema: z.object({
title: z.string(),
publishedDate: z.coerce.date(),
description: z.string(),
tags: z.array(z.string()),
}),
});
export const collections = {
changelog,
};
Two issues stood out: