Files
CompanySite/src/content/config.ts
T

29 lines
1.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { defineCollection, z } from 'astro:content';
const blog = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
description: z.string(),
// Optional SEO overrides. When set they drive the <title> tag and
// <meta name="description"> without changing the on-page article
// heading/excerpt, letting us keep descriptive H1s while tuning the
// search snippet to the 5060 / 150160 character sweet spots.
// `seoTitle` is the text BEFORE the " | WorkRoot" brand suffix.
seoTitle: z.string().optional(),
seoDescription: z.string().optional(),
pubDate: z.coerce.date(),
updatedDate: z.coerce.date().optional(),
heroImage: z.string().optional(),
category: z.enum(['Web Development', 'Mobile Apps', 'AI/ML', 'Cloud', 'DevOps', 'Security']),
tags: z.array(z.string()),
author: z.object({
name: z.string(),
avatar: z.string().optional(),
}),
draft: z.boolean().default(false),
}),
});
export const collections = { blog };