Contentful CMS Provider
This provider aims to allow for a streamlined migration towards Contentful CMS. It contains various functions which transform the received data to be compatible with the archibald/cms module, so that on the client there have to be no to little changes to the cms components logic.
If you consider building up contentful in a green field its advisable to create a new provider for this as you most likely won't need a lot of the transformation logic.
getPage
Gets CMS Entries with the content type "pageTemplate" using the query param pageLabelOrId or pageType to search for contentful entries with a matching slug field.
It then transforms the response data, restructuring slot fields into actual slots and resolving nested components.
Signature
getPage(): Promise<DefaultResponse<Page>>
getCMSEntries
Gets CMS Entries directly, skipping any transformations or implicit filtering. Useful if you want the raw contentful response.
Signature
getCMSEntries(isPreview: boolean, contentType: string, slug?: string): Promise<EntryCollection<EntrySkeletonType, "WITHOUT_UNRESOLVABLE_LINKS", string>>
getPreviewContext
Should handle calls to your CMS api which return preview data.
Signature
getPreviewContext(): Promise<DefaultResponse<Preview>>