Support Forums

Netlify CMS preview not working with gatsbyjs

Hi. I have a problem with previewing my templates - similar to this post - https://answers.netlify.com/t/netlify-cms-custom-preview-not-working-with-gatsbyjs/18155. I tried to follow the config from the official starter repo but couldn’t get it to work.

The repo that I am using for testing is https://github.com/xzrm/gatsby-test. There is only one template to /about for which I am trying to get a preview. However, instead of previewing the actual page, I am getting just the content, see below:

Thanks in advance. Any help is greatly appreciated.

Hi there, @xzrm :wave:

Welcome to the Netlify Forums, and thanks for reaching out. It looks like this thread has been a bit quiet since you opened it. Are you still experiencing difficulties? If so, what additional debugging have you done since you last posted?

You’re registering your preview template to the about page:

CMS.registerPreviewTemplate('about', AboutPagePreview)

Your about page however, is called index:

  - file: "src/pages/about/index.md"
    label: "Page"
    name: "index"
1 Like