Home / File/ content.config.ts — astro Source File

content.config.ts — astro Source File

Architecture documentation for content.config.ts, a typescript file in the astro codebase. 3 imports, 0 dependents.

File typescript CoreAstro RoutingSystem 3 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  92958e0c_acd6_3795_4b72_9ef611831198["content.config.ts"]
  48f80d01_e646_3924_78f6_a9d836644746["astro:content"]
  92958e0c_acd6_3795_4b72_9ef611831198 --> 48f80d01_e646_3924_78f6_a9d836644746
  d47373dc_6761_5858_3027_a4a6472dd795["loaders"]
  92958e0c_acd6_3795_4b72_9ef611831198 --> d47373dc_6761_5858_3027_a4a6472dd795
  0f49b6f2_8b44_baf8_7812_a8fa2dd0ca84["zod"]
  92958e0c_acd6_3795_4b72_9ef611831198 --> 0f49b6f2_8b44_baf8_7812_a8fa2dd0ca84
  style 92958e0c_acd6_3795_4b72_9ef611831198 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { defineCollection } from 'astro:content';
import { glob } from 'astro/loaders';
import { z } from 'astro/zod';

const blog = defineCollection({
	// Load Markdown and MDX files in the `src/content/blog/` directory.
	loader: glob({ base: './src/content/blog', pattern: '**/*.{md,mdx}' }),
	// Type-check frontmatter using a schema
	schema: ({ image }) =>
		z.object({
			title: z.string(),
			description: z.string(),
			// Transform string to Date object
			pubDate: z.coerce.date(),
			updatedDate: z.coerce.date().optional(),
			heroImage: z.optional(image()),
		}),
});

export const collections = { blog };

Domain

Subdomains

Functions

Dependencies

  • astro:content
  • loaders
  • zod

Frequently Asked Questions

What does content.config.ts do?
content.config.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RoutingSystem subdomain.
What functions are defined in content.config.ts?
content.config.ts defines 1 function(s): blog.schema.
What does content.config.ts depend on?
content.config.ts imports 3 module(s): astro:content, loaders, zod.
Where is content.config.ts in the architecture?
content.config.ts is located at examples/blog/src/content.config.ts (domain: CoreAstro, subdomain: RoutingSystem, directory: examples/blog/src).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free