DEV Community

Discussion on: Gatsby and Netlify CMS: First Impressions

Collapse
 
bbarbour profile image
Brian Barbour

I did end up fixing it, but it's been literal months since I worked on the project and forgot the exact details of what I did to fix it.

However, I will provide you my gatsby-config.js file and maybe that can help?

module.exports = {
  siteMetadata: {
    title: '',
    description: '',
  },
  plugins: [
    {
      resolve: "gatsby-source-filesystem",
      options: {
        name: `assets`,
        path: `${__dirname}/static/assets`,
      },
    },
    {
      resolve: `gatsby-transformer-remark`,
      options: {
        plugins: [
          {
            resolve: `gatsby-plugin-netlify-cms-paths`,
            options: {
              cmsConfig: `/static/admin/config.yml`,
            },
          },
          {
            resolve: `gatsby-remark-relative-images`,
            option: {
              name: `assets`,
            },
          },
          {
            resolve: "gatsby-remark-images",
            options: {},
          },
        ],
      },
    },
    {
      resolve: "gatsby-source-filesystem",
      options: {
        name: "chapters",
        path: `${__dirname}/content/chapters`,
      },
    },
    {
      resolve: "gatsby-source-filesystem",
      options: {
        name: "pages",
        path: `${__dirname}/content/pages`,
      },
    },
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: "posts",
        path: `${__dirname}/content/posts`,
      },
    },
    "gatsby-plugin-sharp",
    "gatsby-transformer-sharp",
    `gatsby-plugin-react-helmet`,
    `gatsby-plugin-netlify-cms`,
    "gatsby-plugin-netlify",
  ],
}```

Collapse
 
abeeken profile image
Andrew Beeken

Thank you so much! Unfortunately rejigging this hasn't helped so I feel that the problem is likely elsewhere, either in the frontmatter itself or how I'm building the pages. Ah well, I'm sure I'll reach a conclusion eventually!

Thread Thread
 
bbarbour profile image
Brian Barbour

One thing I do remember clearly is needing to have all the fields in the frontmatter be there, or it would get weird.