aboutsummaryrefslogtreecommitdiff
path: root/www-2/src/content.config.ts
blob: f309aa5643b5323606cd95beff95cacb4ebea099 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { defineCollection } from "astro:content";
import { glob } from "astro/loaders";
import { z } from "astro/zod";

const blogs = defineCollection({
  loader: glob({ pattern: "**/*.md", base: "./content" }),
  schema: z.object({
    title: z.string(),
    description: z.string().optional(),
    date: z.coerce.date(),
    lastmod: z.coerce.date().optional(),
    categories: z.string().optional(),
    tags: z.array(z.string()).optional(),
  }),
});

export const collections = { blogs };