feat: add category page

This commit is contained in:
KazooTTT
2024-07-21 22:29:07 +08:00
parent 3f502739d0
commit 50813b0c43
11 changed files with 320 additions and 51 deletions

View File

@ -12,7 +12,7 @@ const post = defineCollection({
schema: ({ image }) =>
z.object({
title: z.string().max(60),
description: z.string().min(50).max(160),
description: z.string(),
publishDate: z
.string()
.or(z.date())
@ -29,7 +29,8 @@ const post = defineCollection({
.optional(),
draft: z.boolean().default(false),
tags: z.array(z.string()).default([]).transform(removeDupsAndLowerCase),
ogImage: z.string().optional()
ogImage: z.string().optional(),
category: z.string().optional(),
})
})

View File

@ -7,4 +7,5 @@ coverImage:
src: "./cover.png"
alt: "Astro build wallpaper"
tags: ["test", "image"]
category: c1
---

View File

@ -4,6 +4,7 @@ description: "This post is for testing the draft post functionality"
publishDate: "10 Sept 2023"
tags: ["test"]
draft: true
category: c2
---
If this is working correctly, this post should only be accessible in a dev environment, as well as any tags that are unique to this post.

View File

@ -3,6 +3,7 @@ title: "Lorem ipsum dolor sit, amet consectetur adipisicing elit. Id"
description: "This post is purely for testing if the css is correct for the title on the page"
publishDate: "01 Feb 2023"
tags: ["test"]
category: c3
---
## Testing the title tag