Remix
To integrate Content Collections into your Remix app, you can use the @content-collections/remix
package. This package provides a vite plugin to generate the content collections at build time.
Careful
The Remix adapter is compatible exclusively with Remix Vite.
Installation
Install required packages:
We have to install the following packages:
@content-collections/core
@content-collections/remix-vite
After installation we have to add a path alias for the generated collections to the tsconfig.json
:
Add the Content Collections plugin to the Vite config (vite.config.ts
):
API
The package exports a single function as the default export. The function takes a single argument, an object with the following properties:
configPath
(optional)
Specifies the path to the Content Collections configuration file. Defaults to content-collections.ts
.