import { defineCollection, z } from 'astro:content' import { docsLoader } from '@astrojs/starlight/loaders' import { docsSchema } from '@astrojs/starlight/schema' // `loom` is the machine-owned block. Everything else on a page is a person's. const source = z.object({ path: z.string(), etag: z.string(), }) export const collections = { docs: defineCollection({ loader: docsLoader(), schema: docsSchema({ extend: z.object({ loom: z .object({ // Set on a generated page: this is a rendering of somebody's document. generated: z.boolean().optional(), source: z.string().optional(), path: z.string().optional(), etag: z.string().optional(), visibility: z.string().optional(), // Set on a hand-written page: what it was written against. writtenAgainst: z.array(source).optional(), }) .optional(), }), }), }), }