All checks were successful
Build and deploy website / build (push) Successful in 1m56s
Created a new component for a collapsable list Implemented some of the new features. - astro:env - New astro content layer Signed-off-by: Martin Berg Alstad <git@martials.no>
32 lines
841 B
TypeScript
32 lines
841 B
TypeScript
import { defineCollection, z } from "astro:content"
|
|
import { glob } from "astro/loaders"
|
|
|
|
const projectCollection = defineCollection({
|
|
loader: glob({ pattern: "**\/*.mdx", base: "./src/content/projects" }),
|
|
schema: ({ image }) =>
|
|
z.object({
|
|
title: z.string(),
|
|
description: z.string(),
|
|
heroImage: image(),
|
|
heroImageAlt: z.string(),
|
|
tags: z.array(z.string()),
|
|
source: z.string(),
|
|
createdAt: z.string(),
|
|
updatedAt: z.string()
|
|
})
|
|
})
|
|
|
|
const hardwareCollection = defineCollection({
|
|
loader: glob({ pattern: "**\/*.yaml", base: "./src/content/hardware" }),
|
|
schema: z.object({
|
|
title: z.string(),
|
|
accessories: z.optional(z.array(z.string())),
|
|
hardware: z.array(z.string())
|
|
})
|
|
})
|
|
|
|
export const collections = {
|
|
projects: projectCollection,
|
|
hardware: hardwareCollection
|
|
}
|