refactor
This commit is contained in:
parent
846bce9480
commit
60aea94006
32 changed files with 328 additions and 278 deletions
|
|
@ -1,36 +1,17 @@
|
|||
import { defineCollection, z } from "astro:content";
|
||||
|
||||
const postsCollection = defineCollection({
|
||||
type: "content",
|
||||
schema: z.object({
|
||||
title: z.string(),
|
||||
description: z.string().optional(),
|
||||
date: z.string().optional(),
|
||||
useKatex: z.boolean().optional().default(false),
|
||||
useD3: z.boolean().optional().default(false),
|
||||
scripts: z.array(z.string()).optional(),
|
||||
}),
|
||||
});
|
||||
|
||||
const gistsCollection = defineCollection({
|
||||
type: "content",
|
||||
schema: z.object({
|
||||
title: z.string(),
|
||||
description: z.string().optional(),
|
||||
date: z.string().optional(),
|
||||
}),
|
||||
});
|
||||
|
||||
const gitsCollection = defineCollection({
|
||||
type: "content",
|
||||
schema: z.object({
|
||||
title: z.string(),
|
||||
date: z.string().optional(),
|
||||
}),
|
||||
const base = z.object({
|
||||
title: z.string(),
|
||||
description: z.string().optional(),
|
||||
date: z.string().optional(),
|
||||
});
|
||||
|
||||
export const collections = {
|
||||
posts: postsCollection,
|
||||
gists: gistsCollection,
|
||||
git: gitsCollection,
|
||||
algorithms: defineCollection({ type: "content", schema: base }),
|
||||
software: defineCollection({ type: "content", schema: base }),
|
||||
meditations: defineCollection({ type: "content", schema: base }),
|
||||
"autonomous-racing": defineCollection({ type: "content", schema: base }),
|
||||
|
||||
git: defineCollection({ type: "content", schema: base }),
|
||||
gists: defineCollection({ type: "content", schema: base }),
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue