mirror of
https://github.com/redwoodjs/local-ci.git
synced 2026-09-19 07:54:29 +08:00
be06e223d1
* 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>
28 lines
691 B
TypeScript
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],
|
|
});
|