DEV Community

Discussion on: How To Build a Static Website With Contentful and Gridsome

Collapse
 
ffxsam profile image
Sam Hulick

Just a correction:

The proper format for the config file is:

  plugins: [
    {
      use: '@gridsome/source-contentful',
      options: {
        space: 'SPACE_ID',
        accessToken: 'TOKEN',
        host: 'cdn.contentful.com',
        environment: 'master',
        typeName: 'Contentful'
      }
    }
  ],
Enter fullscreen mode Exit fullscreen mode
Collapse
 
ffxsam profile image
Sam Hulick • Edited

Also, this tutorial is maybe missing some steps. When I run gridsome develop after following the steps, I get:

Error: A content type for the ContentfulBlog template does not exist.

Collapse
 
dev23jjl profile image
James

Hi @ffxsam, that would be because you haven't defined a content type that the tutorial uses in Contentful. You need to define a blog post content type in Contentful and depending on what you name that content type, you may need to change some of the query related code.

Thread Thread
 
ffxsam profile image
Sam Hulick

Thanks, James! It's been ages since I've messed with this, and we actually wound up using a different CMS solution. But I'll come back to your post if I ever decide to go this route again.

Thread Thread
 
dev23jjl profile image
James

You're welcome. I understand the switching from one CMS to the next. I've tried numerous, but I think I'm going to stick with Sanity instead of using Contentful.