0.2.3 • Published 10 months ago

@content-collections/next v0.2.3

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

title: Next.js Integration

  1. Install required packages:

    We have to install the following packages:

    • @content-collections/core
    • @content-collections/next
    pnpm add -D @content-collections/core @content-collections/next
  2. Adjust your tsconfig.json:

    {
      "compilerOptions": {
        // ...
        "paths": {
          "@/*": ["./*"],
          "content-collections": ["./.content-collections/generated"]
        }
      }
    }

    We require a path alias for the generated files. This is necessary because we will generate the files in the .content-collections/generated folder.

  3. Modify your next.config.js:

    const { withcontentCollections } = require("@content-collections/next");
    
    /** @type {import('next').NextConfig} */
    const nextConfig = {
       // your next.js config
    };
    
    module.exports = withcontentCollections(nextConfig);

    This will add content collections to the build of your next.js app.

0.2.3

10 months ago

0.2.1

10 months ago

0.2.2

10 months ago

0.2.0

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago