fill most content + improve ux
This commit is contained in:
@@ -1,28 +1,46 @@
|
||||
import { defineCollection, z, type ImageFunction } from 'astro:content'
|
||||
|
||||
export const heroSchema = (image: ImageFunction) =>
|
||||
z.object({
|
||||
title: z.string(),
|
||||
description: z.string(),
|
||||
image: image(),
|
||||
imageAlt: z.string(),
|
||||
cta: z
|
||||
.object({
|
||||
title: z.string(),
|
||||
href: z.string(),
|
||||
target: z.string().optional(),
|
||||
})
|
||||
.optional(),
|
||||
})
|
||||
|
||||
export const coachesSchema = (image: ImageFunction) =>
|
||||
z.object({
|
||||
name: z.string(),
|
||||
description: z.string().optional(),
|
||||
image: image(),
|
||||
imageAlt: z.string(),
|
||||
link: z.string().optional(),
|
||||
})
|
||||
|
||||
export const servicesSchema = z.object({
|
||||
title: z.string(),
|
||||
description: z.string(),
|
||||
price: z.string(),
|
||||
description: z.string().optional(),
|
||||
price: z.string().optional(),
|
||||
link: z.object({
|
||||
title: z.string(),
|
||||
href: z.string(),
|
||||
target: z.string().optional(),
|
||||
}),
|
||||
charachteristics: z.array(
|
||||
z.object({
|
||||
text: z.string(),
|
||||
price: z.string().optional(),
|
||||
})
|
||||
),
|
||||
charachteristics: z
|
||||
.array(
|
||||
z.object({
|
||||
text: z.string(),
|
||||
price: z.string().optional(),
|
||||
})
|
||||
)
|
||||
.optional(),
|
||||
})
|
||||
|
||||
export const reviewsSchema = (image: ImageFunction) =>
|
||||
@@ -40,21 +58,7 @@ export const reviewsSchema = (image: ImageFunction) =>
|
||||
const pages = defineCollection({
|
||||
schema: ({ image }) =>
|
||||
z.object({
|
||||
hero: z
|
||||
.object({
|
||||
title: z.string(),
|
||||
description: z.string(),
|
||||
image: image(),
|
||||
imageAlt: z.string(),
|
||||
cta: z
|
||||
.object({
|
||||
title: z.string(),
|
||||
href: z.string(),
|
||||
target: z.string().optional(),
|
||||
})
|
||||
.optional(),
|
||||
})
|
||||
.nullable(),
|
||||
hero: heroSchema(image).optional(),
|
||||
marquee: z.array(z.string()).optional(),
|
||||
coaches: z.array(coachesSchema(image)).optional(),
|
||||
reviews: z.array(reviewsSchema(image)).optional(),
|
||||
|
||||
Reference in New Issue
Block a user