last commit before switching to nextjs
All checks were successful
Build and Deploy Astro Site / deploy (push) Successful in 24s

This commit is contained in:
2025-09-04 13:26:39 +02:00
parent 5bdf09b9e1
commit 5dd3524aa3
18 changed files with 673 additions and 149 deletions

View File

@@ -0,0 +1,64 @@
import { fields } from '@keystatic/core'
import { z } from 'zod'
export const publishingField = fields.object(
{
publishDate: fields.date({ label: 'Publish Date' }),
editDate: fields.date({ label: 'Edit Date' }),
status: fields.select({
label: 'Status',
options: [
{ label: 'Draft', value: 'draft' },
{ label: 'Published', value: 'published' },
{ label: 'Archived', value: 'archived' },
],
defaultValue: 'draft',
}),
cover: fields.object(
{
src: fields.image({ label: 'Image' }),
alt: fields.text({ label: 'Alt' }),
},
{
label: 'Cover',
}
),
featured: fields.checkbox({
label: 'Featured',
description: 'Show on Homepage',
}),
tags: fields.array(
fields.relationship({
label: 'Tags',
collection: 'tags',
}),
{
label: 'Tags',
itemLabel: (props) => props.value || 'Select Tag',
}
),
author: fields.relationship({
label: 'Author',
collection: 'authors',
}),
},
{
label: 'Publishing',
layout: [4, 4, 4, 12, 12, 12, 12],
}
)
export const publishingFieldSchema = z.object({
publishDate: z.date().optional(),
editDate: z.date().optional(),
status: z.enum(['draft', 'published', 'archived']),
cover: z
.object({
src: z.string(),
alt: z.string(),
})
.optional(),
featured: z.boolean().default(false),
tags: z.array(z.string()).optional(),
author: z.string().optional(),
})