Skip to content

Next.js + Drupal for Incremental Static Regeneration and Preview mode (works with JSON:API and GraphQL).

License

Notifications You must be signed in to change notification settings

sakkelaaksonen-siili/next-drupal

 
 

Repository files navigation

next-drupal

Next.js for Drupal

Next-generation front end for your Drupal site.

Warning: this project is in early beta.

Demo

Documentation

https://next-drupal.org/docs

Example

A page with all "Article" nodes.

import { getResourceCollectionFromContext } from "next-drupal"

export default function IndexPage({ articles }) {
  return (
    <div>
      {articles?.length ? (
        articles.map((node) => (
          <div key={node.id}>
            <h1>{node.title}</h1>
          </div>
        ))
      ) : null}
    </div>
  )
}

export async function getStaticProps(context) {
  return {
    props: {
      articles: await getResourceCollectionFromContext("node--article", context)
      revalidate: 60,
    },
  }
}

Supporting organizations

Development sponsored by Chapter Three

About

Next.js + Drupal for Incremental Static Regeneration and Preview mode (works with JSON:API and GraphQL).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 52.1%
  • TypeScript 43.7%
  • Shell 1.6%
  • JavaScript 1.6%
  • CSS 1.0%