Skip to content

Commit 386ac0f

Browse files
committed
docs: update features code for app router
1 parent 93a0cdc commit 386ac0f

File tree

3 files changed

+21
-35
lines changed

3 files changed

+21
-35
lines changed

www/content/features/authentication.mdx

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,29 @@ weight: 4
66

77
```ts
88
// Bearer token.
9-
export const drupal = new DrupalClient(
10-
process.env.NEXT_PUBLIC_DRUPAL_BASE_URL,
11-
{
12-
auth: {
13-
clientId: process.env.DRUPAL_CLIENT_ID,
14-
clientSecret: process.env.DRUPAL_CLIENT_SECRET,
15-
},
16-
}
17-
)
9+
export const drupal = new NextDrupal(process.env.NEXT_PUBLIC_DRUPAL_BASE_URL, {
10+
auth: {
11+
clientId: process.env.DRUPAL_CLIENT_ID,
12+
clientSecret: process.env.DRUPAL_CLIENT_SECRET,
13+
},
14+
})
1815
```
1916

2017
```ts
2118
// Basic.
22-
export const drupal = new DrupalClient(
23-
process.env.NEXT_PUBLIC_DRUPAL_BASE_URL,
24-
{
25-
auth: {
26-
username: process.env.DRUPAL_USERNAME,
27-
password: process.env.DRUPAL_PASSWORD,
28-
},
29-
}
30-
)
19+
export const drupal = new NextDrupal(process.env.NEXT_PUBLIC_DRUPAL_BASE_URL, {
20+
auth: {
21+
username: process.env.DRUPAL_USERNAME,
22+
password: process.env.DRUPAL_PASSWORD,
23+
},
24+
})
3125
```
3226

3327
```ts
3428
// Bring your own.
35-
export const drupal = new DrupalClient(
36-
process.env.NEXT_PUBLIC_DRUPAL_BASE_URL,
37-
{
38-
auth: () => {
39-
// Do something and return an Authorization header.
40-
},
41-
}
42-
)
29+
export const drupal = new NextDrupal(process.env.NEXT_PUBLIC_DRUPAL_BASE_URL, {
30+
auth: () => {
31+
// Do something and return an Authorization header.
32+
},
33+
})
4334
```

www/content/features/drupal-client.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ weight: 0
55
---
66

77
```ts
8-
// Create a DrupalClient.
9-
const drupal = new DrupalClient("http://drupal.org", {
8+
// Create a NextDrupal Client.
9+
const drupal = new NextDrupal("http://drupal.org", {
1010
auth: {} // Authentication
1111
fetcher: {} // Custom fetcher
1212
cache: {} // Cache support
13-
serializer: {} // Custom serializer
13+
deserializer: {} // Custom deserializer
1414
})
1515
```
1616

www/pages/index.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,11 @@ export default function IndexPage({ features }: IndexPageProps) {
4242
passHref
4343
className="inline-flex space-x-1 mx-auto mb-4 bg-[#111] text-white hover:underline text-sm items-center rounded-full px-4 py-1 font-medium"
4444
>
45-
<span>Next.js 14, Drupal 11 and App Router Support</span>
45+
<span>Next.js 15, Drupal 11 and App Router Support</span>
4646
</Link>
4747
<h1 className="text-4xl font-black tracking-tight text-center md:text-6xl lg:tracking-tighter lg:text-8xl">
4848
Next.js for Drupal
4949
</h1>
50-
{/* <p className="mx-auto mt-4 text-lg text-center text-gray-700 leading-1 md:px-20 lg:leading-normal lg:text-2xl">
51-
Next.js for Drupal has everything you need to build a
52-
next-generation front-end for your Drupal site.
53-
</p> */}
5450
<div className="flex flex-col items-center justify-center py-4 sm:flex-row md:py-8 lg:py-10">
5551
<Link
5652
href="/learn/quick-start"
@@ -150,7 +146,6 @@ export default function IndexPage({ features }: IndexPageProps) {
150146
A powerful client for working with JSON:API.
151147
</p>
152148
</div>
153-
TODO - Update code below for app router
154149
<div className="container max-w-5xl grid-cols-2 gap-6 mx-auto mt-10 md:grid">
155150
<div className="grid grid-flow-row gap-4 mt-10 md:max-w-md auto-rows-max">
156151
{features.map((feature) => (

0 commit comments

Comments
 (0)