Module

cli.commands.collections

Collection commands for managing content schemas.

Functions

collections
📚 Manage content collections. Collections provide type-safe schemas for your content's frontmatter…
1 None
def collections(ctx: click.Context) -> None

📚 Manage content collections.

Collections provide type-safe schemas for your content's frontmatter. Define schemas to validate content during builds and catch errors early.

Commands:

init Generate a starter collections.py file list Show defined collections and their schemas validate Validate content against collection schemas

Parameters 1

Name Type Default Description
ctx click.Context
init_collections
📝 Generate a collections.py file with example schemas. Creates a starter collections.py file at yo…
3 None
def init_collections(force: bool, minimal: bool, source: str) -> None

📝 Generate a collections.py file with example schemas.

Creates a starter collections.py file at your project root with example schemas for blog posts and documentation pages.

Parameters 3

Name Type Default Description
force bool
minimal bool
source str
list_collections
📋 List defined collections and their schemas. Shows all collections defined in collections.py with…
2 None
def list_collections(config: str | None, source: str) -> None

📋 List defined collections and their schemas.

Shows all collections defined in collections.py with their directories and schema fields.

Parameters 2

Name Type Default Description
config str | None
source str
validate_collections
✓ Validate content against collection schemas. Validates all content files against their collectio…
3 None
def validate_collections(collection: str | None, config: str | None, source: str) -> None

✓ Validate content against collection schemas.

Validates all content files against their collection schemas, reporting any validation errors.

Parameters 3

Name Type Default Description
collection str | None
config str | None
source str