Skip to content

Commit 9dcc592

Browse files
committed
feat: update menu strucutre and mark areas in docs that need to be expanded for Pages router
1 parent d851246 commit 9dcc592

File tree

11 files changed

+98
-5
lines changed

11 files changed

+98
-5
lines changed

www/config/docs.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const docsConfig: DocsConfig = {
3434
],
3535
},
3636
{
37-
title: "Drupal Client",
37+
title: "NextDrupal Client",
3838
items: [
3939
{
4040
title: "Introduction",
@@ -94,6 +94,10 @@ export const docsConfig: DocsConfig = {
9494
title: "Advanced Example",
9595
href: "/docs/pages#advanced-example",
9696
},
97+
{
98+
title: "Pages Router",
99+
href: "/docs/pages#pages-router",
100+
},
97101
],
98102
},
99103
{
@@ -196,6 +200,10 @@ export const docsConfig: DocsConfig = {
196200
title: "getAuthorizationHeader",
197201
href: "/docs/reference/getauthorizationheader",
198202
},
203+
{
204+
title: "Pages Router",
205+
href: "/docs/reference/pages-router",
206+
},
199207
],
200208
},
201209
{

www/config/site.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,16 @@ export const site: SiteConfig = {
4444
},
4545
versions: [
4646
{
47-
version: "v1.6.0",
47+
version: "v2.0.0",
4848
active: true,
4949
},
5050
{
51-
version: "v1.0.0",
51+
version: "v1.6.0",
5252
url: "https://v1.next-drupal.org",
5353
},
54+
{
55+
version: "canary",
56+
url: "https://next.next-drupal.org",
57+
},
5458
],
5559
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Next-Drupal 2.0
3+
author: brianperry
4+
date: October 31, 2024
5+
created: "2024-10-31"
6+
excerpt: Next.js 14, Drupal 11 and App Router Support.
7+
published: true
8+
---
9+
10+
Write this post.

www/content/docs/client.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ It also comes with full support for JSON:API write operations which means you ca
2626

2727
## Usage
2828

29+
### App Router
30+
2931
```ts
3032
import { NextDrupal } from "next-drupal"
3133

@@ -41,3 +43,7 @@ const article = await drupal.getResource(
4143
"f4c61473-8297-4bf3-bab7-21c9633a7ca7"
4244
)
4345
```
46+
47+
### Pages Router
48+
49+
TODO

www/content/docs/configuration.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ excerpt: Initialization and options for NextDrupal client.
55

66
## Initialization
77

8+
### App Router
9+
810
To create a new `NextDrupal` client, use the following initialization:
911

1012
```ts
@@ -19,6 +21,8 @@ Where `NEXT_PUBLIC_DRUPAL_BASE_URL` is the URL to your Drupal site defined as an
1921
NEXT_PUBLIC_DRUPAL_BASE_URL=http://example.com
2022
```
2123

24+
### Pages Router
25+
2226
---
2327

2428
## Options
@@ -226,3 +230,5 @@ JSON:API errors are thrown in non-production environments by default. The errors
226230
By default, the resource endpoint will be based on the resource name. If you turn this off, a JSON:API request will retrieve the resource's endpoint url.
227231

228232
---
233+
234+
TODO - Call out any App Router or Pages Router specific options here.

www/content/docs/deserializer.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@ export const drupal = new NextDrupal(process.env.NEXT_PUBLIC_DRUPAL_BASE_URL, {
2929
deserializer: customDeserializer,
3030
})
3131
```
32+
33+
### Pages Router
34+
35+
TODO - the option was called serializer

www/content/docs/faq.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ excerpt: Frequently Asked Questions about Next.js for Drupal
77

88
Next.js for Drupal works requires Drupal 9.3+ and Drupal 10.
99

10+
## Which Next.js versions are supported?
11+
12+
Next.js for Drupal supports both Next.js 13 and Next.js 14. This includes support for both the App Router and the Pages Router.
13+
1014
## Does it work without authentication?
1115

1216
Yes. Authentication is only required for previewing unpublished entities and revisions.

www/content/docs/pages.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,7 @@ export default function Page({ params }) {
159159
## Reference
160160

161161
See the [fetching JSON:API resources](/docs/fetching-resources) section for more examples of fetching resources and collection of resources.
162+
163+
## Pages Router
164+
165+
TODO
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Pages Router
3+
excerpt: An index of methods specific to the Pages Router.
4+
---
5+
6+
TODO
7+
8+
- Link 1
9+
- Link 2

www/content/docs/upgrade-guide.mdx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,42 @@ title: Upgrade Guide
33
excerpt: Guide for upgrading your site to use DrupalClient.
44
---
55

6+
## next-drupal 2.0.0
7+
8+
1. Upgrade to the latest version
9+
10+
```sh
11+
yarn add next-drupal@latest
12+
```
13+
14+
<Callout>
15+
16+
`next-drupal 2.0.0` adds support for the App Router and maintains support for the Pages Router. For information on transitioning from the Pages Router to the App Router, see the [App Router Incremental Adoption Guide](https://nextjs.org/docs/app/building-your-application/upgrading/app-router-migration) guide on the Next.js site.
17+
18+
</Callout>
19+
20+
TODO - Outline breaking changes here.
21+
22+
## next 2.0.0
23+
24+
1. Upgrade your Drupal site to use `next 2.0.0`
25+
26+
```sh
27+
composer require drupal/next
28+
```
29+
30+
2. Run updates:
31+
32+
```sh
33+
drush updb
34+
```
35+
36+
<Callout>
37+
38+
TODO - Describe changes as that will occur as a result of this upgrade.
39+
40+
</Callout>
41+
642
## next-drupal 1.6.0
743

844
1. Upgrade to the latest version

0 commit comments

Comments
 (0)