|
1 | | -import { defineConfig } from "@content-collections/core"; |
| 1 | +import { defineCollection, defineConfig } from "@content-collections/core"; |
| 2 | +import { z } from "zod"; |
2 | 3 |
|
3 | | -// for more information on configuration, visit: |
4 | | -// https://www.content-collections.dev/docs/configuration |
| 4 | +const clients = defineCollection({ |
| 5 | + name: "clients", |
| 6 | + directory: "content/clients", |
| 7 | + include: "**/meta.json", |
| 8 | + parser: "json", |
| 9 | + schema: z.object({ |
| 10 | + name: z.string(), |
| 11 | + description: z.string(), |
| 12 | + href: z.string().optional(), |
| 13 | + avatar: z.string().optional(), |
| 14 | + banner: z.string().optional(), |
| 15 | + start: z.string().optional(), |
| 16 | + end: z.string().optional(), |
| 17 | + hidden: z.boolean().optional().default(false), |
| 18 | + // projects: z.array( |
| 19 | + // z.object({ |
| 20 | + // name: z.string(), |
| 21 | + // description: z.string(), |
| 22 | + // avatar: z.string().optional(), |
| 23 | + // links: z |
| 24 | + // .array( |
| 25 | + // z.object({ |
| 26 | + // name: z.string(), |
| 27 | + // href: z.string(), |
| 28 | + // icon: z.string().optional(), |
| 29 | + // }) |
| 30 | + // ) |
| 31 | + // .optional(), |
| 32 | + // media: z |
| 33 | + // .array( |
| 34 | + // z.object({ |
| 35 | + // media: z.string(), |
| 36 | + // caption: z.string().optional(), |
| 37 | + // }) |
| 38 | + // ) |
| 39 | + // .optional(), |
| 40 | + // }) |
| 41 | + // ), |
| 42 | + testimonials: z |
| 43 | + .array( |
| 44 | + z.object({ |
| 45 | + name: z.string(), |
| 46 | + role: z.string(), |
| 47 | + testimonial: z.string(), |
| 48 | + url: z.string().optional(), |
| 49 | + avatar: z.string().optional(), |
| 50 | + }) |
| 51 | + ) |
| 52 | + .optional(), |
| 53 | + }), |
| 54 | +}); |
| 55 | + |
| 56 | +const artists = defineCollection({ |
| 57 | + name: "artists", |
| 58 | + directory: "content/commissions", |
| 59 | + include: "**/meta.json", |
| 60 | + parser: "json", |
| 61 | + schema: z.object({ |
| 62 | + name: z.string(), |
| 63 | + link: z.string().optional(), |
| 64 | + avatar: z.string().optional(), |
| 65 | + commissions: z.array( |
| 66 | + z.object({ |
| 67 | + slug: z.string(), |
| 68 | + title: z.string(), |
| 69 | + description: z.string().optional(), |
| 70 | + images: z.array(z.string()), |
| 71 | + links: z |
| 72 | + .array( |
| 73 | + z.object({ |
| 74 | + text: z.string(), |
| 75 | + href: z.string(), |
| 76 | + }) |
| 77 | + ) |
| 78 | + .optional(), |
| 79 | + }) |
| 80 | + ), |
| 81 | + }), |
| 82 | +}); |
5 | 83 |
|
6 | 84 | export default defineConfig({ |
7 | | - collections: [], |
| 85 | + collections: [clients, artists], |
8 | 86 | }); |
0 commit comments