Skip to content
Source
Sign inSign up
TanStack/cli
Open History to see the last commit

content-collections.ts

36 lines831 Bytes

1import { defineCollection, defineConfig } from '@content-collections/core'
2import { z } from 'zod'
3​
4const jobs = defineCollection({
5 name: 'jobs',
6 directory: 'content/jobs',
7 include: '**/*.md',
8 schema: z.object({
9 jobTitle: z.string(),
10 summary: z.string(),
11 startDate: z.string(),
12 endDate: z.string().optional(),
13 company: z.string(),
14 location: z.string(),
15 tags: z.array(z.string()),
16 content: z.string(),
17 }),
18})
19​
20const education = defineCollection({
21 name: 'education',
22 directory: 'content/education',
23 include: '**/*.md',
24 schema: z.object({
25 school: z.string(),
26 summary: z.string(),
27 startDate: z.string(),
28 endDate: z.string().optional(),
29 tags: z.array(z.string()),
30 content: z.string(),
31 }),
32})
33​
34export default defineConfig({
35 collections: [jobs, education],
36})