mirror of
https://github.com/jimeh/commonflow.org.git
synced 2026-02-19 05:46:40 +00:00
18 lines
453 B
TypeScript
18 lines
453 B
TypeScript
import { defineCollection, z } from "astro:content";
|
|
import { glob } from "astro/loaders";
|
|
|
|
const spec = defineCollection({
|
|
loader: glob({
|
|
pattern: "**/*.md",
|
|
base: "./src/content/spec",
|
|
// Use filename (without extension) as ID to preserve version strings
|
|
generateId: ({ entry }) => entry.replace(/\.md$/, ""),
|
|
}),
|
|
schema: z.object({
|
|
title: z.string(),
|
|
version: z.string(),
|
|
}),
|
|
});
|
|
|
|
export const collections = { spec };
|