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