Added Projects page
This commit is contained in:
@@ -4,14 +4,11 @@ import { defineCollection, z } from 'astro:content';
|
||||
import { isValidTime } from './utils/time';
|
||||
|
||||
const blog = defineCollection({
|
||||
// Load Markdown and MDX files in the `src/content/blog/` directory.
|
||||
loader: glob({ base: './src/content/blog', pattern: '**/*.{md,mdx}' }),
|
||||
// Type-check frontmatter using a schema
|
||||
schema: z.object({
|
||||
title: z.string(),
|
||||
summary: z.string(),
|
||||
image: z.string().optional(),
|
||||
// Transform string to ZonedDateTime object
|
||||
pubDate: z.string().refine(isValidTime),
|
||||
updatedDate: z.string().refine(isValidTime).optional(),
|
||||
unlisted: z.boolean().optional(),
|
||||
@@ -20,4 +17,13 @@ const blog = defineCollection({
|
||||
}),
|
||||
});
|
||||
|
||||
export const collections = { blog };
|
||||
const projects = defineCollection({
|
||||
loader: glob({ base: './src/content/projects', pattern: '**/*.{md,mdx}' }),
|
||||
schema: z.object({
|
||||
name: z.string(),
|
||||
url: z.string(),
|
||||
image: z.string().optional(),
|
||||
})
|
||||
})
|
||||
|
||||
export const collections = { blog, projects };
|
||||
|
||||
Reference in New Issue
Block a user