Skip to content

Commit

Permalink
chore: trigger ci by formatting readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mgoudy91 committed Aug 30, 2024
1 parent 7b0d47c commit 1ad1295
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
</a>
</p>


A toolkit of Next.js helpers that make it easier to use Contentful in a Next.js project hosted on Vercel.

This toolkit is intended as a companion to Contentful's Vercel App, a Contentful Marketplace integration that helps your content team get up and running quickly with your Vercel project powered by Contentful.
Expand All @@ -27,7 +26,6 @@ This toolkit is intended as a companion to Contentful's Vercel App, a Contentful

## Getting Started


Install the toolkit using npm:

```sh
Expand All @@ -47,28 +45,24 @@ Contentful's Vercel App makes use of these handlers to provide preview URLs that
#### App Router usage

If your NextJs project is using [App Router](https://nextjs.org/docs/app),
create a `route.ts` or `route.js` [route handler](https://nextjs.org/docs/app/building-your-application/routing/route-handlers) file in a dedicated folder (e.g. `api/enable-draft`) inside your `app` directory:

create a `route.ts` or `route.js` [route handler](https://nextjs.org/docs/app/building-your-application/routing/route-handlers) file in a dedicated folder (e.g. `api/enable-draft`) inside your `app` directory:

```ts
// app/api/enable-draft/route.ts|js

export { enableDraftHandler as GET } from "@contentful/vercel-nextjs-toolkit/app-router"
export { enableDraftHandler as GET } from '@contentful/vercel-nextjs-toolkit/app-router';
```


#### Pages Router usage

If your NextJs project is using [Pages Router](https://nextjs.org/docs/pages), create an `enable-draft.ts` or `enable-draft.js` [API route](https://nextjs.org/docs/pages/building-your-application/routing/api-routes) file inside the `pages/api` directory:

If your NextJs project is using [Pages Router](https://nextjs.org/docs/pages), create an `enable-draft.ts` or `enable-draft.js` [API route](https://nextjs.org/docs/pages/building-your-application/routing/api-routes) file inside the `pages/api` directory:

```ts
// pages/api/enable-draft.ts|js

export { enableDraftHandler as default } from "@contentful/vercel-nextjs-toolkit/pages-router";
export { enableDraftHandler as default } from '@contentful/vercel-nextjs-toolkit/pages-router';
```


#### Preview URL output

With these handlers installed aboves, you can construct preview URLs that activate Draft Mode and redirect the user to a desired path in your application.
Expand All @@ -94,7 +88,7 @@ The values provided in the `x-vercel-*` query parameters trigger Vercel to set a
## Additional helpful resources

* To be completed
- To be completed

## Reach out to us

Expand Down

0 comments on commit 1ad1295

Please sign in to comment.