diff --git a/public/images/maciejpedzich-placeholder.jpg b/public/images/maciejpedzich-placeholder.jpg new file mode 100644 index 0000000..e7a28bc Binary files /dev/null and b/public/images/maciejpedzich-placeholder.jpg differ diff --git a/src/content/cats/maciejpedzich-placeholder.json b/src/content/cats/maciejpedzich-placeholder.json new file mode 100644 index 0000000..473989c --- /dev/null +++ b/src/content/cats/maciejpedzich-placeholder.json @@ -0,0 +1,12 @@ +{ + "name": "Placeholder", + "description": "This is a placeholder cat with a photo taken from placekitten.com", + "image": { + "src": "/images/maciejpedzich-placeholder.jpg", + "alt": "Sample alt text" + }, + "owner": { + "name": "Maciej Pędzich", + "link": "https://maciejpedzi.ch" + } +} diff --git a/src/content/config.ts b/src/content/config.ts new file mode 100644 index 0000000..012ecc6 --- /dev/null +++ b/src/content/config.ts @@ -0,0 +1,20 @@ +import { z, defineCollection } from 'astro:content'; + +const cats = defineCollection({ + type: 'data', + schema: z.object({ + name: z.string(), + description: z.string().max(250), + image: z.object({ + src: z.string(), + alt: z.string() + }), + passedAway: z.boolean().optional().default(false), + owner: z.object({ + name: z.string(), + link: z.string().optional() + }) + }) +}); + +export const collections = { cats }; diff --git a/src/env.d.ts b/src/env.d.ts index f964fe0..acef35f 100644 --- a/src/env.d.ts +++ b/src/env.d.ts @@ -1 +1,2 @@ +/// ///