mirror of
https://github.com/Fluffy-Bean/website.git
synced 2025-06-02 00:33:14 +00:00
Tags and Filtering
Yeet projects, as they're identical to posts in every way but name Add OpenGraph for SEO Add Plugin prop to Layout to avoid loading unnecessary JS and CSS
This commit is contained in:
parent
745ac58045
commit
291552c340
21 changed files with 336 additions and 212 deletions
|
@ -1,28 +1,17 @@
|
|||
import { z, defineCollection } from "astro:content";
|
||||
import { z, defineCollection, reference } from "astro:content";
|
||||
|
||||
const postsCollection = defineCollection({
|
||||
const posts = defineCollection({
|
||||
type: "content",
|
||||
schema: z.object({
|
||||
draft: z.boolean().optional().default(false),
|
||||
title: z.string(),
|
||||
description: z.string(),
|
||||
pubDate: z.string().transform((str) => new Date(str)),
|
||||
tags: z.array(z.string()),
|
||||
tags: z.array(reference("tags")),
|
||||
}),
|
||||
});
|
||||
|
||||
const projectsCollection = defineCollection({
|
||||
type: "content",
|
||||
schema: z.object({
|
||||
draft: z.boolean().optional().default(false),
|
||||
title: z.string(),
|
||||
description: z.string(),
|
||||
pubDate: z.string().transform((str) => new Date(str)),
|
||||
tags: z.array(z.string()),
|
||||
}),
|
||||
});
|
||||
|
||||
const certificatesCollection = defineCollection({
|
||||
const certificates = defineCollection({
|
||||
type: "data",
|
||||
schema: z.object({
|
||||
title: z.string(),
|
||||
|
@ -33,8 +22,15 @@ const certificatesCollection = defineCollection({
|
|||
}),
|
||||
});
|
||||
|
||||
const tags = defineCollection({
|
||||
type: "content",
|
||||
schema: z.object({
|
||||
name: z.string(),
|
||||
})
|
||||
})
|
||||
|
||||
export const collections = {
|
||||
posts: postsCollection,
|
||||
projects: projectsCollection,
|
||||
certificates: certificatesCollection,
|
||||
posts,
|
||||
certificates,
|
||||
tags,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue