Open
Description
In our content schemas, it is possible to provide an featured image but no alt text for it. Our schemas hold them separately as in:
featuredImage: image().optional(),
featuredImageAlt: z.string().optional(),
a schema like this would prevent authors from adding an image without also including alt text:
featuredImage: z.object({
src: image(),
alt: z.string()
}).optional(),
which also makes it possible to provide a default with accurate alt text, as in:
featuredImage: z.object({
src: image(),
alt: z.string()
}).optional().default({
src: PlaceholderImage
alt: 'the p5 logo in a grey box'
}),
Metadata
Metadata
Assignees
Labels
No labels