Creative portfolio website for joshhd.co.uk.
Built with Gatsby, Contentful and GraphQL, deployed via Netlify, managed with kanban project in GitHub.
- tested to node
v18.20.4
,v21.x
- install using
nvm install 18
- use elevated shell to set nvm to use this version:
nvm use 18
- install dependencies
- [!] node-gyp errors relating to visual studio can be resolved by running in VS Command Prompt to ensure native build tools are used for C++.
npm i
- run setup script
npm run setup
- Install Contentful CLI if you haven't
npm install -g contentful-cli
- Login to Contentful
contentful login
- paste the code from the browser to the cli
- get Space Id and content delivery token from Settings > Api keys
- Export your space data
contentful space export `
--space-id YOUR_SPACE_ID `
--management-token YOUR_MANAGEMENT_TOKEN `
--export-dir ./contentful `
--content-file export.json
- [!] Note: Setup script creates these for you.
Put Contentful env variables in .env.production
file:
CONTENTFUL_SPACE_ID=<space-id>
CONTENTFUL_ACCESS_TOKEN=<access-token>
To set the node environment to pick these up during build and serve:
"scripts": {
"build": "set NODE_ENV=production& gatsby build",
"serve": "set NODE_ENV=production& gatsby serve"
}