Skip to content

Hidden templateKey fields not saving to .md file #843

Open
@joseph-facta

Description

@joseph-facta

Bug report

What is the current behavior?
The hidden fields for new pages I am creating are not being saved to the .md file that Netlify CMS creates, so Gatsby fails to build, as there is no path to a component.

If the current behavior is a bug, please provide the steps to reproduce.
I created a new page in the config.yml file, adding the following under the file collection:
image

I then navigated to the /admin page, and edited the new Sidebar page. I saw a new file appear at /pages/sidebar/index.md. However, the hidden templateKey field was not present, and the compilation failed at this point.

I have pushed my repo to this repository.

What is the expected behavior?
I would expect to see the hidden fields I placed in the config.yml file to appear in the final index.md file.

Other relevant information:

System:
OS: Windows 10 10.0.19043
CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
Binaries:
Node: 16.13.1 - C:\Program Files\nodejs\node.EXE
npm: 8.1.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.19041.1266.0), Chromium (101.0.1210.32)
npmPackages:
gatsby: ^4.12.1 => 4.12.1
gatsby-plugin-image: ^2.0.0 => 2.3.0
gatsby-plugin-netlify: ^4.2.0 => 4.2.0
gatsby-plugin-netlify-cms: ^6.12.1 => 6.12.1
gatsby-plugin-purgecss: ^6.0.0 => 6.1.0
gatsby-plugin-react-helmet: ^5.0.0 => 5.3.0
gatsby-plugin-sass: ^5.0.0 => 5.3.0
gatsby-plugin-sharp: ^4.0.0 => 4.3.0
gatsby-remark-copy-linked-files: ^5.0.0 => 5.3.0
gatsby-remark-images: ^6.0.0 => 6.3.0
gatsby-remark-relative-images: ^0.3.0 => 0.3.0
gatsby-source-filesystem: ^4.0.0 => 4.3.0
gatsby-transformer-remark: ^5.0.0 => 5.3.0
gatsby-transformer-sharp: ^4.0.0 => 4.3.0
npmGlobalPackages:
gatsby-cli: 4.13.0

Node.js version: 16.13.1
NPM/Yarn version: NPM v8.1.2
Operating System: Windows 10
Additional tools:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions