Skip to content

Commit 7f0a200

Browse files
authored
docs: Final 2.0 Docs Updates (#835)
1 parent 20a38be commit 7f0a200

17 files changed

+66
-63
lines changed

www/config/site.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const site: SiteConfig = {
2828
},
2929
{
3030
title: "API",
31-
href: "/api/modules.html",
31+
href: "/api/modules",
3232
},
3333
{
3434
title: "Blog",

www/content/docs/authentication.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ To configure authentication, provide a `client_id` and `client_secret` as option
5353

5454
<Callout icon="⚠️">
5555

56-
You need to enable the `simple_oauth` module on Drupal.
56+
You need to enable the `simple_oauth` module in Drupal.
5757

5858
</Callout>
5959

@@ -105,7 +105,7 @@ You can also use the basic authorization using a `username` and `password`:
105105

106106
<Callout icon="⚠️">
107107

108-
You need to enable the `basic_auth` module on Drupal.
108+
You need to enable the `basic_auth` module in Drupal.
109109

110110
</Callout>
111111

www/content/docs/cache.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ You can provide your own cache implementation using the [`cache`](/docs/configur
1515

1616
Here's an example on how you can use Redis to cache resources.
1717

18-
<Callout>
19-
20-
Note: as of `next-drupal 1.3.0`, only `getResource` and `getMenu` support caching.
21-
22-
</Callout>
23-
2418
```ts title=lib/drupal.ts
2519
import { NextDrupal, DataCache } from "next-drupal"
2620
import Redis from "ioredis"

www/content/docs/creating-resources.mdx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ title: Creating Resources (POST)
33
excerpt: How to create JSON:API resources using NextDrupal client.
44
---
55

6-
<Callout icon="⚠️">
7-
8-
The `createResource` and `createFileResource` helpers are available in `next-drupal ^1.4.0`.
9-
10-
</Callout>
11-
126
<Callout>
137

148
If you're working with JSON:API, be mindful to select the option:
@@ -71,7 +65,7 @@ const article = await drupal.createResource("node--article", {
7165
})
7266
```
7367

74-
See the API reference for [createResource](/docs/reference/createresource).
68+
See the API reference for [createResource](/api/classes/NextDrupal#createresource).
7569

7670
---
7771

@@ -116,7 +110,7 @@ const media = await drupal.createResource<DrupalMedia>("media--image", {
116110
})
117111
```
118112

119-
See the API reference for [createFileResource](/docs/reference/createfileresource).
113+
See the API reference for [createFileResource](/api/classes/NextDrupal#createfileresource).
120114

121115
---
122116

www/content/docs/deleting-resources.mdx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ title: Deleting Resources (DELETE)
33
excerpt: How to delete JSON:API resources using NextDrupal.
44
---
55

6-
<Callout icon="⚠️">
7-
8-
The `deleteResource` helper is available in `next-drupal ^1.4.0`.
9-
10-
</Callout>
11-
126
<Callout>
137

148
If you're working with JSON:API, be mindful to select the option:
@@ -34,7 +28,7 @@ const deleted = await drupal.deleteResource(
3428
)
3529
```
3630

37-
See the API reference for [deleteResource](/docs/reference/deleteresource).
31+
See the API reference for [deleteResource](/api/classes/NextDrupal#deleteresource).
3832

3933
---
4034

www/content/docs/fetching-resources.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const block = await drupal.getResource(
5555
)
5656
```
5757

58-
See the API reference for [getResource](/docs/reference/getresource).
58+
See the API reference for [getResource](/api/classes/NextDrupal#getresource).
5959

6060
---
6161

@@ -67,7 +67,7 @@ Fetch an article by path.
6767
const article = await drupal.getResourceByPath("/blog/slug-for-article")
6868
```
6969

70-
See the API reference for [getResourceByPath](/docs/reference/getresourcebypath).
70+
See the API reference for [getResourceByPath](/api/classes/NextDrupal#getresourcebypath).
7171

7272
---
7373

@@ -90,7 +90,7 @@ const articles = await drupal.getResourceCollection("node--article", {
9090
})
9191
```
9292

93-
See the API reference for [getResourceCollection](/docs/reference/getresourcecollection).
93+
See the API reference for [getResourceCollection](/api/classes/NextDrupal#getresourcecollection).
9494

9595
---
9696

@@ -108,7 +108,7 @@ Fetch a menu by name
108108
const menu = await drupal.getMenu("main")
109109
```
110110

111-
See the API reference for [getMenu](/docs/reference/getmenu).
111+
See the API reference for [getMenu](/api/classes/NextDrupal#getmenu).
112112

113113
---
114114

@@ -126,7 +126,7 @@ Fetch a view by name and display_id.
126126
const view = await drupal.getView("promoted_items--block_1")
127127
```
128128

129-
See the API reference for [getView](/docs/reference/getview).
129+
See the API reference for [getView](/api/classes/NextDrupal#getview).
130130

131131
---
132132

@@ -148,7 +148,7 @@ const results = await drupal.getSearchIndex(indexName, {
148148
})
149149
```
150150

151-
See the API reference for [getSearchIndex](/docs/reference/getsearch).
151+
See the API reference for [getSearchIndex](/api/classes/NextDrupal#getsearchindex).
152152

153153
---
154154

www/content/docs/index.mdx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@ Welcome to the next-drupal documentation.
77

88
This documentation covers `next-drupal 2.0`.
99

10-
<!--
11-
************************************************************
12-
* TODO: Remove this block before publishing.
13-
14-
* Comment: Modify url for older versions' documentation
15-
************************************************************
16-
-->
17-
1810
If you're using an older version, you can find the documentation [here](https://v1.next-drupal.org).
1911

2012
---
@@ -52,7 +44,7 @@ npx create-next-app -e https://github.com/chapter-three/next-drupal-basic-starte
5244
</CardBody>
5345
</Card>
5446

55-
<Card href="/docs/reference">
47+
<Card href="/api/modules">
5648
<CardHeading>API Reference</CardHeading>
5749
<CardBody>
5850
<p>API Reference for NextDrupal client.</p>

www/content/docs/typescript.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Every helper method for the `NextDrupal` client has full TypeScript support.
77

88
The `next-drupal` module ships with some default basic types you can use.
99

10+
For a full list of all types, consult the [API Reference](/api/modules).
11+
1012
---
1113

1214
## Built-in Types

www/content/docs/updating-resources.mdx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ title: Updating Resources (PATCH)
33
excerpt: How to update JSON:API resources using NextDrupal client.
44
---
55

6-
<Callout icon="⚠️">
7-
8-
The `updateResource` helper is available in `next-drupal ^1.4.0`.
9-
10-
</Callout>
11-
126
<Callout>
137

148
If you're working with JSON:API, be mindful to select the option:
@@ -65,7 +59,7 @@ const article = await drupal.updateResource(
6559
)
6660
```
6761

68-
See the API reference for [updateResource](/docs/reference/updateresource).
62+
See the API reference for [updateResource](/api/classes/NextDrupal#updateresource).
6963

7064
---
7165

www/content/guides/umami-demo.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ composer create-project drupal/recommended-project umami
1717
"extra": {
1818
"patches": {
1919
"drupal/decoupled_router": {
20-
"Unable to resolve path on node in other language than default": "https://www.drupal.org/files/issues/2024-10-22/decoupled_router-3111456-resolve-langcode-issue-78--external-redirects.patch"
20+
"Unable to resolve path on node in other language than default": "https://www.drupal.org/files/issues/2024-08-05/decouple_router-3111456-resolve-language-issue-63--get-translation-re-rolled-and-good-redirect.patch"
2121
}
2222
},
2323
}
@@ -26,7 +26,7 @@ composer create-project drupal/recommended-project umami
2626
3. Add dependencies
2727

2828
```bash
29-
composer require drupal/next drupal/jsonapi_menu_items drupal/jsonapi_views drupal/jsonapi_resources
29+
composer require drupal/next drupal/jsonapi_menu_items drupal/jsonapi_views drupal/jsonapi_resources cweagans/composer-patches
3030
```
3131

3232
4. Install Drupal. Make sure you select **Demo: Umami Food Magazine (Experimental)** as the installation profile.
@@ -75,6 +75,8 @@ yarn dev
7575

7676
5. Visit `http://localhost:3000` to see the Next.js site.
7777

78+
<!--
79+
7880
---
7981

8082
## How to enable authentication
@@ -112,3 +114,5 @@ NEXT_IMAGE_DOMAIN=localhost
112114
3. **Save configuration**
113115

114116
You can now visit `http://localhost:3000/articles/new` to create a new article.
117+
118+
-->

0 commit comments

Comments
 (0)