next drupal
1.0.0
https://demo.next-drupal.org
https://next-drupal.org
帶有所有“文章”節點的頁面。
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 ,
} ,
}
} 第三章贊助的發展
如果您有興趣為Drupal貢獻Next.js,請在提交拉動請求之前閱讀貢獻指南。