All checks were successful
Build and deploy website / build (push) Successful in 39s
- Code style is Catppuccin Mocha - Added lang tag to project - Added keywords to project - Sort projects by latest updated
34 lines
944 B
TypeScript
34 lines
944 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({
|
|
lang: z.union([z.literal("en"), z.literal("nb")]),
|
|
title: z.string(),
|
|
description: z.string(),
|
|
heroImage: image(),
|
|
heroImageAlt: z.string(),
|
|
tags: z.array(z.string()),
|
|
keywords: z.array(z.string()),
|
|
source: z.string().url(),
|
|
createdAt: z.string().date(),
|
|
updatedAt: z.string().date(),
|
|
}),
|
|
})
|
|
|
|
const usesCollection = defineCollection({
|
|
loader: glob({ pattern: "**\/*.yaml", base: "./src/content/uses" }),
|
|
schema: z.object({
|
|
title: z.string(),
|
|
accessories: z.optional(z.array(z.string())),
|
|
hardware: z.array(z.string()),
|
|
}),
|
|
})
|
|
|
|
export const collections = {
|
|
projects: projectCollection,
|
|
uses: usesCollection,
|
|
}
|