DotCMS as a hybrid CMS allows you not only edit regular pages but also Single Page Apps.
This projects works as a starter to create your Single Page App with all the needs to make it ediable by DotCMS edit capabilities.
We are using the latest NextJS features to statically render all the DotCMS pages and publish it to Netlify
With the release of NextJS 9.3 you can use its Static Site Generator feature to create static DotCMS pages in build time, this is the approach we took here, in a overview we:
- We pull all the pages from DotCMS instance
- Generate each page with React Components
- Public to Netlify
We are using NextJS but with a custom NodeJS with Express framework. This server handle the POST request for our Single-page Application (SPA) Editor
- Run
npm i
- Run
npm run setup:dev
- This will promp you with some question about the project
- Get DotCMS token
- Create the
.env
file and start dev server
You can run: npm run buildl npm run export
this will spit out all your pages in out
folder.
Run npm run test
.
We are using Jest and Enzime for tests.