mirror of
https://github.com/maciejpedzich/cats-album.git
synced 2024-11-09 23:03:02 +01:00
Introduce a dateAdded field in content config
This commit is contained in:
parent
d36de6ccbd
commit
9449d528f2
@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "Placeholder",
|
||||
"dateAdded": "2023-09-02T18:50:00.066Z",
|
||||
"description": "This is a placeholder cat with a photo taken from placekitten.com",
|
||||
"image": {
|
||||
"src": "/images/maciejpedzich-placeholder.jpg",
|
||||
|
@ -4,6 +4,10 @@ const cats = defineCollection({
|
||||
type: 'data',
|
||||
schema: z.object({
|
||||
name: z.string(),
|
||||
dateAdded: z
|
||||
.string()
|
||||
.or(z.date())
|
||||
.transform((val) => new Date(val)),
|
||||
description: z.string().max(250),
|
||||
image: z.object({
|
||||
src: z.string(),
|
||||
|
Loading…
Reference in New Issue
Block a user