Skip to content

Instantly share code, notes, and snippets.

@kimschles
Last active August 5, 2024 02:35
Show Gist options
  • Save kimschles/c4be8ad244ca08be78bd834f729c3152 to your computer and use it in GitHub Desktop.
Save kimschles/c4be8ad244ca08be78bd834f729c3152 to your computer and use it in GitHub Desktop.
Contentful + Gatsby Starter Blog

Prerequisites

  • A Contentful Account
  • Terminal Application
  • Node.js >= 18.0.0
  • NPM (should be installed with Node.js)

Instructions

  1. Clone the Blog Starter Repo with the command git clone https://github.com/contentful/starter-gatsby-blog.git
  2. Change into the directory with cd starter-gatsby-blog/
  3. Run the command npm install
  4. Through the Contentful Web App, create a new space called gatsby-blog
  5. Click into your new Space
  6. Look at the content model (it will be empty)
  7. Find and copy your Space ID
  8. Run the command npm run setup
  9. Paste your space ID in response to the prompt
  10. Create a CMA token and paste in terminal
  11. Create an API key and copy your CDA token
  12. Past your CDA token in the terminal
  13. Check your content model (there should be a blog post and person content type)
  14. Start your dev server by running the command npm run dev
  15. See your site by opening localhost:8000 in your browser
  16. Checkout GraphQL at http://localhost:8000/_graphql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment