Skip to content

Search the guides, deployment pages, and API reference.

ContentLoader

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

A loader that resolves a whole collection by filling a store.

Its shape is the claim that one execution produces the complete answer, which is what lets contentLayer() run it during the build and inline the result.

Properties

name

name: string;

Methods

load()

load(context): void | Promise<void>;

Reads the whole source and writes every entry through context.store.set. Runs on the collection's first read, or at build time under contentLayer(), and the result is kept for every read after it.

Parameters

context

LoaderContext

Returns

void | Promise<void>


watchedPaths()?

optional watchedPaths(): string[];

The files or directories the last load read, for a development host to watch. Omit it, or return nothing, for a source with no local files.

Returns

string[]