// Content collection for the prose documentation. The markdown files under // src/content/docs/ are generated by scripts/prepare-docs.mjs from the repo's // own docs/*.md — see that script for why, and package.json's "build"/"dev" // scripts for when it runs. Do not hand-edit anything in src/content/docs/. import { glob } from "astro/loaders"; import { defineCollection, z } from "astro:content"; const docs = defineCollection({ loader: glob({ pattern: "**/*.md", base: "./src/content/docs" }), schema: z.object({ title: z.string(), slug: z.string(), sourcePath: z.string(), // Real provenance for the docs pages' hover affordance — see // scripts/prepare-docs.mjs, which computes both from the actual file // and its actual git history. Never a placeholder or invented value. contentHash: z.string(), lastCommit: z.string(), // The page's opening paragraph, flattened by scripts/prepare-docs.mjs // into the line a link unfurler shows. Absent for a file that opens on // something other than prose; the site's own description covers that. description: z.string().optional(), }), }); export const collections = { docs };