martials.no/src/content/config.ts
Martin Berg Alstad a2584b97a1
All checks were successful
Build and deploy website / build (push) Successful in 39s
Added Sb1 Actual integration to projects.
- Code style is Catppuccin Mocha
- Added lang tag to project
- Added keywords to project
- Sort projects by latest updated
2025-02-27 21:13:01 +01:00

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,
}