sundays/src/content.config.ts

24 lines
855 B
TypeScript
Raw Normal View History

2026-06-05 14:31:12 -06:00
import { defineCollection } from 'astro:content';
import { glob } from 'astro/loaders';
import { z } from 'astro/zod';
const notes = defineCollection({
loader: glob({base: './src/notes', pattern: '**/*.{md,mdx}'}),
schema: z.object({
title: z.string(),
2026-12-03 20:22:10 -07:00
subtitle: z.string().optional(),
2026-06-05 14:31:12 -06:00
date: z.string().transform((s) => {
return new Date(`${s}T00:00:00-0700`);
2026-06-05 14:31:12 -06:00
}),
2026-12-03 20:22:10 -07:00
scripture: z.string().optional(),
2026-06-05 14:31:12 -06:00
meta_description: z.string().optional(),
sub_heading: z.string().optional(),
scripture_category: z.string().default('gospels'),
post_image: z.string().optional(),
tags: z.array(z.string()).optional(),
2026-06-07 20:30:04 -06:00
published: z.boolean().optional().default(true),
2026-08-07 14:39:40 -06:00
types: z.array(z.string()).optional(),
2026-06-05 14:31:12 -06:00
}),
});
export const collections = { notes };