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 3 imports

Entity Profile

Dependency Diagram

graph LR
  e4b9f397_872c_8e73_ac91_e9936f7947d7["content.config.ts"]
  57096fb8_3fb5_1319_b2b6_ba8488b380f0["loaders"]
  e4b9f397_872c_8e73_ac91_e9936f7947d7 --> 57096fb8_3fb5_1319_b2b6_ba8488b380f0
  199cb0c0_7c92_5375_9195_0f59939b49ed["astro:content"]
  e4b9f397_872c_8e73_ac91_e9936f7947d7 --> 199cb0c0_7c92_5375_9195_0f59939b49ed
  82c23b20_84b3_3038_cd30_be2e0f2ef654["zod"]
  e4b9f397_872c_8e73_ac91_e9936f7947d7 --> 82c23b20_84b3_3038_cd30_be2e0f2ef654
  style e4b9f397_872c_8e73_ac91_e9936f7947d7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

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

const blogCC = defineCollection({
	loader: glob({ pattern: "**/*.{md,mdx,mdoc}", base: "./src/content/blog-cc" }),
	schema: z.object({
		title: z.string(),
		description: z.string().optional(),
	}),
});

const blogCL = defineCollection({
  // By default the ID is a slug, generated from the path of the file relative to `base`
  loader: glob({ pattern: "**/*", base: "./src/blog-cl" }),
  schema: z.object({
    title: z.string(),
    description: z.string().optional(),
  }),
});

const dataSchema = z.object({ name: z.string(), color: z.string() });
const dataYML = defineCollection({ loader: file('src/data-cl.yml'), schema: dataSchema });
const dataJSON = defineCollection({ loader: file('src/data-cl.json'), schema: dataSchema });
const dataWithSchemaMisuse = defineCollection({
	loader: file('src/$schema-misuse.json'),
	schema: z.object({ value: z.number() }),
});
const dataDates = defineCollection({
	loader: file('src/data-dates.yml'),
	schema: z.object({
		date: z.coerce.date()
	})
})

export const collections = {
	"blog-cc": blogCC,
	"blog-cl": blogCL,
	"data-cl": dataYML,
	"data-cl-json": dataJSON,
	"data-schema-misuse": dataWithSchemaMisuse,
	"data-dates": dataDates
};

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.
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 packages/astro/test/fixtures/content-intellisense/src/content.config.ts (directory: packages/astro/test/fixtures/content-intellisense/src).

Analyze Your Own Codebase

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

Try Supermodel Free