parent
0aca915e21
commit
2333694e2c
62 changed files with 124 additions and 139 deletions
@ -1,9 +1,11 @@ |
|||||||
import { authorCollection } from './author'; |
import { authorCollection } from './author'; |
||||||
import { guideCollection } from './guide'; |
import { guideCollection } from './guide'; |
||||||
|
import { projectCollection } from './project'; |
||||||
import { questionGroupCollection } from './question-group'; |
import { questionGroupCollection } from './question-group'; |
||||||
|
|
||||||
export const collections = { |
export const collections = { |
||||||
authors: authorCollection, |
authors: authorCollection, |
||||||
guides: guideCollection, |
guides: guideCollection, |
||||||
'question-groups': questionGroupCollection, |
'question-groups': questionGroupCollection, |
||||||
|
projects: projectCollection, |
||||||
}; |
}; |
||||||
|
@ -0,0 +1,28 @@ |
|||||||
|
import { defineCollection, z } from 'astro:content'; |
||||||
|
|
||||||
|
export const projectDifficulties = [ |
||||||
|
'beginner', |
||||||
|
'intermediate', |
||||||
|
'advanced', |
||||||
|
] as const; |
||||||
|
export type ProjectDifficultyType = (typeof projectDifficulties)[number]; |
||||||
|
|
||||||
|
export const projectCollection = defineCollection({ |
||||||
|
type: 'content', |
||||||
|
schema: z.object({ |
||||||
|
title: z.string(), |
||||||
|
description: z.string(), |
||||||
|
isNew: z.boolean(), |
||||||
|
sort: z.number(), |
||||||
|
difficulty: z.enum(projectDifficulties), |
||||||
|
nature: z.string(), |
||||||
|
skills: z.array(z.string()), |
||||||
|
seo: z.object({ |
||||||
|
title: z.string(), |
||||||
|
description: z.string(), |
||||||
|
keywords: z.array(z.string()), |
||||||
|
ogImageUrl: z.string().optional(), |
||||||
|
}), |
||||||
|
roadmapIds: z.array(z.string()), |
||||||
|
}), |
||||||
|
}); |
Loading…
Reference in new issue