🎨 Next.js WordPress theme - Celestia
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
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
- Prerendering
- 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
}
}
}
}