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. 5 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  6701f32e_5f47_2ad2_aaa6_e72b4a79cbcc["content.config.ts"]
  85f62603_2561_5ccc_90da_2a4d0c64699b["./loaders/post-loader.js"]
  6701f32e_5f47_2ad2_aaa6_e72b4a79cbcc --> 85f62603_2561_5ccc_90da_2a4d0c64699b
  48f80d01_e646_3924_78f6_a9d836644746["astro:content"]
  6701f32e_5f47_2ad2_aaa6_e72b4a79cbcc --> 48f80d01_e646_3924_78f6_a9d836644746
  0f49b6f2_8b44_baf8_7812_a8fa2dd0ca84["zod"]
  6701f32e_5f47_2ad2_aaa6_e72b4a79cbcc --> 0f49b6f2_8b44_baf8_7812_a8fa2dd0ca84
  d47373dc_6761_5858_3027_a4a6472dd795["loaders"]
  6701f32e_5f47_2ad2_aaa6_e72b4a79cbcc --> d47373dc_6761_5858_3027_a4a6472dd795
  146dc5fe_1437_ad00_4647_01bc965224c2["promises"]
  6701f32e_5f47_2ad2_aaa6_e72b4a79cbcc --> 146dc5fe_1437_ad00_4647_01bc965224c2
  style 6701f32e_5f47_2ad2_aaa6_e72b4a79cbcc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { defineCollection, reference } from 'astro:content';
import { z } from 'astro/zod';
import { file, glob } from 'astro/loaders';
import { loader } from './loaders/post-loader.js';
import { readFile } from 'fs/promises';

const blog = defineCollection({
	loader: loader({ url: 'https://jsonplaceholder.typicode.com/posts' }),
});

const dogs = defineCollection({
	loader: file('src/data/dogs.json'),
	schema: z.object({
		breed: z.string(),
		id: z.string(),
		size: z.string(),
		origin: z.string(),
		lifespan: z.string(),
		temperament: z.array(z.string()),
	}),
});

const rodents = defineCollection({
	loader: () => ({
		capybara: {
			name: 'Capybara',
			scientificName: 'Hydrochoerus hydrochaeris',
			lifespan: 10,
			weight: 50000,
			diet: ['grass', 'aquatic plants', 'bark', 'fruits'],
			nocturnal: false,
		},
		hamster: {
			name: 'Golden Hamster',
			scientificName: 'Mesocricetus auratus',
			lifespan: 2,
			weight: 120,
			diet: ['seeds', 'nuts', 'insects'],
			nocturnal: true,
		},
		rat: {
			name: 'Brown Rat',
			scientificName: 'Rattus norvegicus',
			lifespan: 2,
			weight: 350,
			diet: ['grains', 'fruits', 'vegetables', 'meat'],
			nocturnal: true,
		},
		mouse: {
			name: 'House Mouse',
			scientificName: 'Mus musculus',
			lifespan: 1,
			weight: 20,
			diet: ['seeds', 'grains', 'fruits'],
			nocturnal: true,
		},
		guineaPig: {
			name: 'Guinea Pig',
			scientificName: 'Cavia porcellus',
			lifespan: 5,
// ... (350 more lines)

Subdomains

Dependencies

  • ./loaders/post-loader.js
  • astro:content
  • loaders
  • promises
  • 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 IntegrationAdapters domain, SsrAdapters subdomain.
What functions are defined in content.config.ts?
content.config.ts defines 8 function(s): cats.loader, dynamicImport.loader, images.loader, images.schema, rockets.schema, rodents.loader, spacecraft.schema, spacecraftNoBody.schema.
What does content.config.ts depend on?
content.config.ts imports 5 module(s): ./loaders/post-loader.js, astro:content, loaders, promises, zod.
Where is content.config.ts in the architecture?
content.config.ts is located at packages/astro/test/fixtures/content-layer/src/content.config.ts (domain: IntegrationAdapters, subdomain: SsrAdapters, directory: packages/astro/test/fixtures/content-layer/src).

Analyze Your Own Codebase

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

Try Supermodel Free