Requirements
- Craft CMS Pro (v3.4+)
- Node.js (v8.3+)
- Yarn or NPM
- Gridsome CLI
Setup Craft CMS
- Install the Gridsome Nogn plugin
- Enable the GraphQL endpoint in
config/routes.php
- Use the Nogn UI to connect to the Gridsome site, and select the sections to enable live preview
Gridsome steps
gridsome create my-new-site
- Create a gridsome sitecd my-new-site
- Go in the folderyarn add @nogn/gridsome-source-craft
- Install the source pluginAdd the plugin config to the
gridsome.config.js
file (swapinghttps://example.com/api
for your endpoint):module.exports = { plugins: [ { use: '@nogn/gridsome-source-craft', options: { url: 'https://example.com/api', livePreview: process.env.CRAFT_LIVE_PREVIEW || false, // Use false in production }, }, ], }
create a
.env
file withCRAFT_LIVE_PREVIEW=true
Boot up the local server
yarn develop
(this will then be available at http://localhost:8080)Check the Gridsome GraphQL explorer to confirm the craft data is there (http://localhost:8080/___explore)
Congratulations. NOGN is ready 🎉.
Now see how to setup templates using the Craft content.