Skip to content

TypeScript API / @laikacms/astro/loader / LaikaCollectionsOptions

Interface: LaikaCollectionsOptions ​

Extends ​

Properties ​

allowEmpty? ​

ts
optional allowEmpty?: boolean;

Return {} instead of throwing when the catalog enumerates nothing. Off by default: an empty collections export is almost always a misconfiguration, and failing loudly beats a site that silently has no content.


catalog? ​

ts
optional catalog?: CatalogChoice;

Which catalog maps a collection to a directory. Defaults to 'convention'. Ignored when repositories is given.

Inherited from ​

LaikaRepositoryOptions.catalog


configKey? ​

ts
optional configKey?: string;

Where the Decap config lives, for catalog: 'decap'. Defaults to 'config'.

Inherited from ​

LaikaRepositoryOptions.configKey


defaultExtension? ​

ts
optional defaultExtension?: string;

File extension applied to keys without one. Defaults to 'json'.

Inherited from ​

LaikaRepositoryOptions.defaultExtension


dir? ​

ts
optional dir?: string;

Directory the default filesystem repository reads, resolved relative to the Astro project root. Ignored when storage or repositories is given. Defaults to 'content'.

Inherited from ​

LaikaRepositoryOptions.dir


exclude? ​

ts
optional exclude?: string[];

Skip these collections.


include? ​

ts
optional include?: string[];

Only these collections. Defaults to every document collection in the catalog.


overrides? ​

ts
optional overrides?: Record<string, CollectionOverride>;

Per-collection overrides.


render? ​

ts
optional render?: RenderOptions;

Applied to every collection; a per-collection override wins.


repositories? ​

ts
optional repositories?: any;

Bring your own repositories. Highest precedence — nothing else in this struct is read when it is set.

Inherited from ​

LaikaRepositoryOptions.repositories


root? ​

ts
optional root?: string;

Astro project root, for resolving a relative dir. Defaults to process.cwd().


serializers? ​

ts
optional serializers?: StorageSerializerRegistry;

Serializer registry for the default filesystem repository.

Inherited from ​

LaikaRepositoryOptions.serializers


storage? ​

ts
optional storage?: StorageRepository;

Provide only the storage repository; the documents and assets repositories are derived from it via Catalog. Ignored when repositories is given.

Inherited from ​

LaikaRepositoryOptions.storage


z? ​

ts
optional z?: ZodNamespace;

The z from astro:content. Supply it to derive a schema per collection from the catalog's fields. Omit it and collections are created without a schema — content still loads, it is just not validated.

Released under the MIT License.