@pitlane/content
Schema-validated, cross-referenced content collections for Remix 3.
createContent declares collections of Markdown, MDX, JSON, and
YAML entries, each read by a loader from @pitlane/content/loaders and
validated by a Standard Schema, and returns a client a controller queries
with getCollection() and getEntry(). The entry types come from the
schemas, with nothing generated.
See
Interfaces
- Collection. The query surface of one collection.
- CollectionDefinition. What
c.collection({ loader, schema })returns. - ContentBuilder. The builder
createContenthands to its callback. - ContentLoader. A loader that resolves a whole collection by filling a store.
- Entry. One entry of a collection, as a caller sees it.
- EntryBody. The raw source of an entry's document, before anything renders it.
- GenerateIdOptions. Options handed to a
loaders.globgenerateIdfunction. - Heading. A heading collected from a Markdown or MDX document.
- LiveEntry. What a LiveLoader returns for one entry.
- LiveLoader. A loader that answers one query at a time.
- LoadedEntry. What a ContentLoader writes into the store for one entry.
- LoaderContext. What a loader is handed to read its source and validate what it found.
- Reference. A resolved pointer from one entry to another, produced by
c.reference(collection). - RenderedEntry. What
entry.render()resolves to.
Type Aliases
- CollectionEntry. One entry of
collection, named the way an application thinks of it:CollectionEntry<typeof content.blog>. - Content. The object
createContentreturns: one Collection per key of the definitions its callback returned, named after that key and typed by the output of that collection's schema. - Loader. Either kind of loader.
- ReferenceSchema. The schema
c.reference(collection)returns: a Standard Schema that reads an entry id (a string) and outputs a Reference intocollection.
Functions
- createContent. Declares a set of content collections.