Skip to content

TypeScript API / @contentia/astro/loader / DocumentsLoaderOptions

Interface: DocumentsLoaderOptions ​

Extends ​

Properties ​

catalog? ​

ts
catalog?: CatalogChoice;

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

Inherited from ​

ContentiaRepositoryOptions.catalog


collection? ​

ts
collection?: string;

The Contentia collection key. Defaults to the Astro collection name.


configKey? ​

ts
configKey?: string;

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

Inherited from ​

ContentiaRepositoryOptions.configKey


defaultExtension? ​

ts
defaultExtension?: string;

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

Inherited from ​

ContentiaRepositoryOptions.defaultExtension


dir? ​

ts
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 ​

ContentiaRepositoryOptions.dir


documents? ​

ts
documents?: DocumentsRepository;

The documents repository to read. Highest precedence — when given, no repository is constructed and the rest of ContentiaRepositoryOptions is ignored. This is how you read from a remote Contentia server: pass a DocumentsJsonApiProxyRepository.


entry? ​

ts
entry?: EntryOptions;

name? ​

ts
name?: string;

Loader name, which is what refreshContent({ loaders }) targets. Defaults to 'contentia'.


render? ​

ts
render?: RenderOptions;

repositories? ​

ts
repositories?: any;

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

Inherited from ​

ContentiaRepositoryOptions.repositories


root? ​

ts
root?: string;

Astro project root, for resolving a relative dir before load runs.


select? ​

ts
select?: DocumentSelectOptions;

serializers? ​

ts
serializers?: StorageSerializerRegistry;

Serializer registry for the default filesystem repository.

Inherited from ​

ContentiaRepositoryOptions.serializers


storage? ​

ts
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 ​

ContentiaRepositoryOptions.storage


sync? ​

ts
sync?: SyncOptions;

z? ​

ts
z?: ZodNamespace;

The z from astro:content.

Supplying it — together with an explicit collection and a catalog that can describe the collection's fields — lets the loader derive the collection schema from the catalog instead of you restating it here. Astro also generates entry types from it, so entry.data stays fully typed.

Omit it and the collection is unvalidated unless you pass your own schema to defineCollection.