Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/jhroemer/jhroemer.github.io. My personal website jensroemer.com
Something went wrong. Try again.
681 B · 22 lines
TypeScript
at main
1234567891011121314151617181920212223// Import utilities from `astro:content`import { defineCollection } from "astro:content";import { glob } from "astro/loaders";import { z } from "astro/zod";
// Define a `loader` and `schema` for each collectionconst postsCollection = defineCollection({ loader: glob({ pattern: "**/*.{md,mdx}", base: "./src/content/posts" }), schema: z.object({ title: z.string(), pubDate: z.date(), tags: z.array(z.string()), draft: z.boolean().optional(), ogImage: z.string().optional(), bskyPostId: z.string().optional(), }),});
// Export a single `collections` object to register your collection(s)export const collections = { posts: postsCollection,};