aboutsummaryrefslogtreecommitdiff
path: root/www-2/src/content.config.ts
blob: f8a3aa178f0a4eb4cf82bbbb2c78eb7cbae1d03f (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 articles = 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 = { articles };