Variable: collections

View as Markdown
const collections: Collections<Source>;

Defined in: content.ts:61

Every collection in your config, for a name only known at runtime, eg a route param. Import a collection by its name otherwise, which bundles only that collection. Provided by the tomekit() Vite plugin, or by tomekit/register outside Vite; importing it without either throws.

Example

import { collections } from "tomekit/content";

collections.names(); // ["notes", "posts"]
if (collections.has(params.collection)) collections.get(params.collection).slugs();