diff --git a/www/config/docs.ts b/www/config/docs.ts index 1bdbed9d..7a914109 100644 --- a/www/config/docs.ts +++ b/www/config/docs.ts @@ -34,7 +34,7 @@ export const docsConfig: DocsConfig = { ], }, { - title: "Drupal Client", + title: "NextDrupal Client", items: [ { title: "Introduction", @@ -94,6 +94,10 @@ export const docsConfig: DocsConfig = { title: "Advanced Example", href: "/docs/pages#advanced-example", }, + { + title: "Pages Router", + href: "/docs/pages#pages-router", + }, ], }, { @@ -196,6 +200,10 @@ export const docsConfig: DocsConfig = { title: "getAuthorizationHeader", href: "/docs/reference/getauthorizationheader", }, + { + title: "Pages Router", + href: "/docs/reference/pages-router", + }, ], }, { diff --git a/www/config/site.ts b/www/config/site.ts index 63ec53e3..83effd88 100644 --- a/www/config/site.ts +++ b/www/config/site.ts @@ -44,12 +44,16 @@ export const site: SiteConfig = { }, versions: [ { - version: "v1.6.0", + version: "v2.0.0", active: true, }, { - version: "v1.0.0", + version: "v1.6.0", url: "https://v1.next-drupal.org", }, + { + version: "canary", + url: "https://next.next-drupal.org", + }, ], } diff --git a/www/content/blog/next-drupal-2-0.mdx b/www/content/blog/next-drupal-2-0.mdx new file mode 100644 index 00000000..74a1552c --- /dev/null +++ b/www/content/blog/next-drupal-2-0.mdx @@ -0,0 +1,10 @@ +--- +title: Next-Drupal 2.0 +author: brianperry +date: October 31, 2024 +created: "2024-10-31" +excerpt: Next.js 14, Drupal 11 and App Router Support. +published: true +--- + +Write this post. diff --git a/www/content/docs/client.mdx b/www/content/docs/client.mdx index 5e629080..a286d01d 100644 --- a/www/content/docs/client.mdx +++ b/www/content/docs/client.mdx @@ -26,6 +26,8 @@ It also comes with full support for JSON:API write operations which means you ca ## Usage +### App Router + ```ts import { NextDrupal } from "next-drupal" @@ -41,3 +43,7 @@ const article = await drupal.getResource( "f4c61473-8297-4bf3-bab7-21c9633a7ca7" ) ``` + +### Pages Router + +TODO diff --git a/www/content/docs/configuration.mdx b/www/content/docs/configuration.mdx index 3e5293af..9813951e 100644 --- a/www/content/docs/configuration.mdx +++ b/www/content/docs/configuration.mdx @@ -5,6 +5,8 @@ excerpt: Initialization and options for NextDrupal client. ## Initialization +### App Router + To create a new `NextDrupal` client, use the following initialization: ```ts @@ -19,6 +21,8 @@ Where `NEXT_PUBLIC_DRUPAL_BASE_URL` is the URL to your Drupal site defined as an NEXT_PUBLIC_DRUPAL_BASE_URL=http://example.com ``` +### Pages Router + --- ## Options @@ -226,3 +230,5 @@ JSON:API errors are thrown in non-production environments by default. The errors 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. --- + +TODO - Call out any App Router or Pages Router specific options here. diff --git a/www/content/docs/deserializer.mdx b/www/content/docs/deserializer.mdx index 50a81197..37188dac 100644 --- a/www/content/docs/deserializer.mdx +++ b/www/content/docs/deserializer.mdx @@ -29,3 +29,7 @@ export const drupal = new NextDrupal(process.env.NEXT_PUBLIC_DRUPAL_BASE_URL, { deserializer: customDeserializer, }) ``` + +### Pages Router + +TODO - the option was called serializer diff --git a/www/content/docs/faq.mdx b/www/content/docs/faq.mdx index 88b0f663..6ae8c91d 100644 --- a/www/content/docs/faq.mdx +++ b/www/content/docs/faq.mdx @@ -7,6 +7,10 @@ excerpt: Frequently Asked Questions about Next.js for Drupal Next.js for Drupal works requires Drupal 9.3+ and Drupal 10. +## Which Next.js versions are supported? + +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. + ## Does it work without authentication? Yes. Authentication is only required for previewing unpublished entities and revisions. diff --git a/www/content/docs/pages.mdx b/www/content/docs/pages.mdx index 2102032c..a76f685c 100644 --- a/www/content/docs/pages.mdx +++ b/www/content/docs/pages.mdx @@ -159,3 +159,7 @@ export default function Page({ params }) { ## Reference See the [fetching JSON:API resources](/docs/fetching-resources) section for more examples of fetching resources and collection of resources. + +## Pages Router + +TODO diff --git a/www/content/docs/reference/pages-router.mdx b/www/content/docs/reference/pages-router.mdx new file mode 100644 index 00000000..87b8d996 --- /dev/null +++ b/www/content/docs/reference/pages-router.mdx @@ -0,0 +1,9 @@ +--- +title: Pages Router +excerpt: An index of methods specific to the Pages Router. +--- + +TODO + +- Link 1 +- Link 2 diff --git a/www/content/docs/upgrade-guide.mdx b/www/content/docs/upgrade-guide.mdx index 49b2c9bf..ba032dd9 100644 --- a/www/content/docs/upgrade-guide.mdx +++ b/www/content/docs/upgrade-guide.mdx @@ -3,6 +3,42 @@ title: Upgrade Guide excerpt: Guide for upgrading your site to use DrupalClient. --- +## next-drupal 2.0.0 + +1. Upgrade to the latest version + +```sh +yarn add next-drupal@latest +``` + + + +`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. + + + +TODO - Outline breaking changes here. + +## next 2.0.0 + +1. Upgrade your Drupal site to use `next 2.0.0` + +```sh +composer require drupal/next +``` + +2. Run updates: + +```sh +drush updb +``` + + + +TODO - Describe changes as that will occur as a result of this upgrade. + + + ## next-drupal 1.6.0 1. Upgrade to the latest version diff --git a/www/pages/index.tsx b/www/pages/index.tsx index eacdb322..8ecdd3a9 100644 --- a/www/pages/index.tsx +++ b/www/pages/index.tsx @@ -34,14 +34,15 @@ export default function IndexPage({ features }: IndexPageProps) { return ( + TODO - Re-order elements on home page
- Next.js 13, Drupal 10 and Stable On-demand Revalidation + Next.js 14, Drupal 11 and App Router Support

The future of Drupal is headless @@ -159,6 +160,7 @@ export default function IndexPage({ features }: IndexPageProps) { A powerful client for working with JSON:API.

+ TODO - Update code below for app router
{features.map((feature) => (