Files
redwoodjs__local-ci/apps/website/content-collections.ts
Peter Pistorius be06e223d1 feat(website): add blog section with first post (#113)
* feat(website): add blog section with first post

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(website): integrate blog section with routing and styles

* Add lock file.

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 08:51:14 +02:00

28 lines
691 B
TypeScript

import { defineCollection, defineConfig } from "@content-collections/core";
import { compileMarkdown } from "@content-collections/markdown";
import { z } from "zod";
const posts = defineCollection({
name: "posts",
directory: "./src/blog/content/",
include: "*.md",
schema: z.object({
title: z.string(),
summary: z.string(),
date: z.coerce.date(),
author: z.string(),
protected: z.boolean().optional(),
}),
transform: async (document, context) => {
const html = await compileMarkdown(context, document); // HTML compilation for Workers
return {
...document,
html,
};
},
});
export default defineConfig({
collections: [posts],
});