Skip to content

Search the guides, deployment pages, and API reference.

ContentBuilder

import type { ContentBuilder } from "@pitlane/content";

The builder createContent hands to its callback.

Methods

collection()

collection<S>(input): CollectionDefinition<S>;

Declares one collection: where its entries come from and the schema each must satisfy.

Type Parameters

S

S extends StandardSchemaV1<unknown>

Parameters

input
loader

Loader

schema

S

Returns

CollectionDefinition<S>


reference()

reference<C>(collection): ReferenceSchema<C>;

A schema for a field holding the id of an entry in collection, which parses to a Reference that collection's getEntry accepts.

Type Parameters

C

C extends string

Parameters

collection

C

Returns

ReferenceSchema<C>