next drupal
1.0.0
https://demo.next-drupal.org
https://next-drupal.org
Halaman dengan semua node "artikel".
import { DrupalClient } from "next-drupal"
const drupal = new DrupalClient ( "https://cms.next-drupal.org" )
export default function BlogPage ( { articles } ) {
return (
< div >
{ articles ?. length
? nodes . map ( ( node ) => (
< div key = { node . id } >
< h1 > { node . title } </ h1 >
</ div >
) )
: null }
</ div >
)
}
export async function getStaticProps ( context ) {
const articles = await drupal . getResourceCollectionFromContext (
"node--article" ,
context
)
return {
props : {
articles ,
} ,
}
} Pengembangan yang disponsori oleh Bab Tiga
Jika Anda tertarik untuk berkontribusi pada Next.js untuk Drupal, silakan baca pedoman yang berkontribusi sebelum mengirimkan permintaan tarik.