feat: extracts some repeated logic out into lib/ files

This commit is contained in:
Lewis Wynne 2026-01-31 22:10:03 +00:00
parent 38653f2aa1
commit 99c1539aad
22 changed files with 200 additions and 336 deletions

View file

@ -3,15 +3,14 @@ import { glob, file } from 'astro/loaders';
import { z } from 'astro/zod';
import yaml from 'js-yaml';
const posts = defineCollection({
loader: glob({ pattern: '**/*.md', base: './src/content/posts' }),
const md = defineCollection({
loader: glob({ pattern: '**/*.md', base: './src/content/md' }),
schema: z.object({
title: z.string(),
date: z.coerce.date(),
pinned: z.boolean().optional(),
category: z.string().optional(),
draft: z.boolean().optional(),
slug: z.string(),
})
});
@ -29,4 +28,4 @@ const bookmarks = defineCollection({
})
});
export const collections = { posts, bookmarks };
export const collections = { md, bookmarks };