26 lines
767 B
TypeScript
26 lines
767 B
TypeScript
import { defineContentConfig, defineCollection } from "@nuxt/content";
|
|
import { z } from "zod";
|
|
|
|
export default defineContentConfig({
|
|
collections: {
|
|
articles: defineCollection({
|
|
type: "page",
|
|
source: {
|
|
include: "articles/*.md",
|
|
prefix: "/",
|
|
},
|
|
schema: z.object({
|
|
title: z.string(),
|
|
description: z.string().optional(),
|
|
category: z.string().optional(),
|
|
tags: z.array(z.string()).optional(),
|
|
author: z.string().optional(),
|
|
contributors: z.array(z.string()).optional(),
|
|
published: z.boolean().default(true),
|
|
featured: z.boolean().default(false),
|
|
accessLevel: z.string().optional(),
|
|
publishedAt: z.string().optional(),
|
|
}),
|
|
}),
|
|
},
|
|
});
|