-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(next-drupal): updated learn section
- Loading branch information
Marco Monti
committed
Jul 11, 2024
1 parent
d67f2cf
commit 6c0e389
Showing
11 changed files
with
93 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
www/content/tutorials/draft-mode/configure-draft-routes.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
title: Configure Draft Routes | ||
excerpt: Draft routes in Next.js | ||
weight: 140 | ||
group: Draft Mode | ||
--- | ||
|
||
Implement draft mode using two API routes. | ||
|
||
<Callout> | ||
|
||
If you're using the Basic Starter, draft routes are already created for you. | ||
|
||
</Callout> | ||
|
||
## /app/api/draft/route.ts | ||
|
||
```ts title=app/api/draft/route.ts | ||
import { drupal } from "@/lib/drupal" | ||
import { enableDraftMode } from "next-drupal/draft" | ||
import type { NextRequest } from "next/server" | ||
|
||
export async function GET(request: NextRequest): Promise<Response | never> { | ||
return enableDraftMode(request, drupal) | ||
} | ||
``` | ||
|
||
--- | ||
|
||
## /app/api/disable-draft/route.ts | ||
|
||
```ts title=app/api/disable-draft/route.ts | ||
import { disableDraftMode } from "next-drupal/draft" | ||
import type { NextRequest } from "next/server" | ||
|
||
export async function GET(request: NextRequest) { | ||
return disableDraftMode() | ||
} | ||
``` |
43 changes: 0 additions & 43 deletions
43
www/content/tutorials/draft-mode/configure-preview-routes.mdx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters