@imranhsayed/nextjs-headless-wordpress

1.0.4 • Public • Published

🎨 Next.js WordPress theme - Celestia

Project Status: Active. Stars Forks Contributors Follow

Development

npm run dev # Runs next dev which starts Next.js in development mode
npm run build # Runs next build which builds the application for production usage
npm run start # Runs next start which starts a Next.js production server

Cypress Tests

To run cypress locally we run cypress-open It adds a cypress directory and some example test in cypress/integrations

npm run cypress:open
  • Cypress docs
  1. API

Debugging with Node.js debugger tool.

Notice that we have added this in package.json

"dev": "NODE_OPTIONS='--inspect' next",

when you run npm run dev, you will see a node js icon in the Chrome inspector tab and there will also be a url to access it on the terminal that says Debugger listeing on ...

Important concepts

  1. Prerendering
  2. Querying blocks: WP GraphQL Gutenberg allows you to query Gutenberg blocks. If you want to break down the blocks and render the content using individual React components, here is the query example.
{
  posts {
    nodes {
      title
      blocks {
        name
        innerBlocks {
          name
          saveContent
        }
        saveContent
      }
    }
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @imranhsayed/nextjs-headless-wordpress

Weekly Downloads

1

Version

1.0.4

License

ISC

Unpacked Size

100 kB

Total Files

59

Last publish

Collaborators

  • imranhsayed