website/src/content.config.ts
lew 8a9c56c3d5 flatten monorepo, migrate off Vercel
- Remove penfield (split to own repo on Forgejo)
- Move www/ contents to root, rename to wynne.rs
- Swap @astrojs/vercel for @astrojs/node, upgrade to Astro 6
- Remove auth-astro/GitHub OAuth (TinyAuth at proxy layer)
- Remove Vercel deploy webhook
- Switch to local SQLite DB (drop Turso)
- Update generate-stats.js for new build output paths
2026-04-05 01:04:11 +01:00

31 lines
862 B
TypeScript

import { defineCollection } from 'astro:content';
import { glob, file } from 'astro/loaders';
import { z } from 'astro/zod';
import yaml from 'js-yaml';
const posts = defineCollection({
loader: glob({ pattern: '**/*.md', base: './content' }),
schema: z.object({
title: z.string(),
date: z.coerce.date(),
updated: z.coerce.date().optional(),
category: z.string().optional(),
related: z.array(z.string()).optional(),
})
});
const bookmarks = defineCollection({
loader: file('./content/bookmarks.yaml', {
parser: (text) => {
const data = yaml.load(text) as Array<Record<string, unknown>>;
return data.map((item, i) => ({ id: String(i), ...item }));
},
}),
schema: z.object({
title: z.string(),
url: z.string().url(),
date: z.coerce.date(),
})
});
export const collections = { posts, bookmarks };