This commit is contained in:
2025-04-23 10:05:58 -03:00
parent 270a9c6e68
commit 2794934520
21 changed files with 1083 additions and 192 deletions

View File

@@ -1,8 +1,8 @@
import { defineCollection, z, reference } from 'astro:content'
import { glob } from 'astro/loaders'
import { defineCollection, z, reference } from "astro:content";
import { glob } from "astro/loaders";
const trainers = defineCollection({
loader: glob({ pattern: '**/*.md', base: './src/content/trainers' }),
loader: glob({ pattern: "**/*.md", base: "./src/content/trainers" }),
schema: ({ image }) =>
z.object({
name: z.string(),
@@ -10,14 +10,14 @@ const trainers = defineCollection({
networks: z.array(
z.object({
alt: z.string(),
url: z.string(),
url: z.string().url(),
}),
),
}),
})
});
const courses = defineCollection({
loader: glob({ pattern: '**/*.md', base: './src/content/courses' }),
loader: glob({ pattern: "**/*.{md,mdx}", base: "./src/content/courses" }),
schema: ({ image }) =>
z.object({
id: z.string(),
@@ -28,16 +28,7 @@ const courses = defineCollection({
course: z.object({
hours: z.number(),
reciclagem: z.boolean().default(false),
modules: z.array(
z.union([
z.object({
summary: z.string(),
content: z.string(),
}),
z.string(),
]),
),
trainer: reference('trainers').optional(),
trainer: reference("trainers").optional(),
}),
seo: z
.object({
@@ -46,6 +37,6 @@ const courses = defineCollection({
.optional(),
draft: z.boolean().default(true),
}),
})
});
export const collections = { trainers, courses }
export const collections = { trainers, courses };