New blog post not visible on website, the new .md file has different format and charaters how to change?

Hello there, my newly created blog post content is not showing on my website. I noticed that the contents of the .md files are different.

Is it possible to change the layout and special charaters that will be generated to the new .md file that Netlify CMS creates to the same format and characters as that Hugo uses?

Sincerely

Hugo supports the layout in the right too and so do most Markdown parsers. I’d assume there’s something else going on. If you could share the site name, we can take a better look.

Hello, first of all thank you for your interest in looking for a solution with me. The site is: https://www.vandenboom.icu
Do I need to try to create a new blog post first?

Well, at this point if you don’t have any post created with Netlify CMS, creating a new post would definitely help.

What exactly is the problem you’re seeing? Are the builds failing or something? If so, would you paste the deploy link?

Hello, thanks again for taking the time to help me resolve the issue. You were right my builds are failing. My most recent build failed with the following deploy details logging information:

10:17:54 PM: Build ready to start
10:17:56 PM: build-image version: 6ebfb829398e07eb99ad5455777162ff19838822 (xenial)
10:17:56 PM: build-image tag: v3.10.5
10:17:56 PM: buildbot version: 9bc48650b0551281ca8258d0c32d371dd2b6993b
10:17:57 PM: Fetching cached dependencies
10:17:57 PM: Starting to download cache of 161.5MB
10:17:58 PM: Finished downloading cache in 1.399666091s
10:17:58 PM: Starting to extract cache
10:18:02 PM: Finished extracting cache in 3.540587919s
10:18:02 PM: Finished fetching cache in 4.976568319s
10:18:02 PM: Starting to prepare the repo for build
10:18:03 PM: Preparing Git Reference refs/heads/main
10:18:05 PM: Parsing package.json dependencies
10:18:06 PM: Different build command detected, going to use the one specified in the Netlify configuration file: 'hugo --gc --minify' versus 'hugo' in the Netlify UI
10:18:06 PM: Starting build script
10:18:06 PM: Installing dependencies
10:18:06 PM: Python version set to 2.7
10:18:07 PM: Started restoring cached node version
10:18:09 PM: Finished restoring cached node version
10:18:10 PM: v12.18.0 is already installed.
10:18:11 PM: Now using node v12.18.0 (npm v6.14.4)
10:18:11 PM: Started restoring cached build plugins
10:18:11 PM: Finished restoring cached build plugins
10:18:11 PM: Attempting ruby version 2.7.1, read from environment
10:18:11 PM: Started restoring cached ruby version
10:18:12 PM: Finished restoring cached ruby version
10:18:14 PM: Using ruby version 2.7.1
10:18:14 PM: Using PHP version 5.6
10:18:14 PM: Installing Hugo 0.79.0
10:18:14 PM: Hugo Static Site Generator v0.79.0-1415EFDC/extended linux/amd64 BuildDate: 2020-11-27T09:16:17Z
10:18:14 PM: Started restoring cached go cache
10:18:14 PM: Finished restoring cached go cache
10:18:14 PM: go version go1.14.4 linux/amd64
10:18:14 PM: go version go1.14.4 linux/amd64
10:18:14 PM: Installing missing commands
10:18:14 PM: Verify run directory
10:18:16 PM: ​
10:18:16 PM: ────────────────────────────────────────────────────────────────
10:18:16 PM:   Netlify Build                                                 
10:18:16 PM: ────────────────────────────────────────────────────────────────
10:18:16 PM: ​
10:18:16 PM: ❯ Version
10:18:16 PM:   @netlify/build 26.3.3
10:18:16 PM: ​
10:18:16 PM: ❯ Flags
10:18:16 PM:   baseRelDir: true
10:18:16 PM:   buildId: 620ebb82b6ea100007b2a713
10:18:16 PM:   deployId: 620ebb82b6ea100007b2a715
10:18:16 PM: ​
10:18:16 PM: ❯ Current directory
10:18:16 PM:   /opt/build/repo
10:18:16 PM: ​
10:18:16 PM: ❯ Config file
10:18:16 PM:   /opt/build/repo/netlify.toml
10:18:16 PM: ​
10:18:16 PM: ❯ Context
10:18:16 PM:   production
10:18:16 PM: ​
10:18:16 PM: ❯ Loading plugins
10:18:16 PM:    - @netlify/plugin-sitemap@0.8.1 from Netlify app
10:18:16 PM:    - netlify-plugin-submit-sitemap@0.2.3 from Netlify app
10:18:18 PM: ​
10:18:18 PM: ────────────────────────────────────────────────────────────────
10:18:18 PM:   1. build.command from netlify.toml                            
10:18:18 PM: ────────────────────────────────────────────────────────────────
10:18:18 PM: ​
10:18:18 PM: $ hugo --gc --minify
10:18:18 PM: Start building sites …
10:18:19 PM: ERROR 2022/02/17 21:18:19 render of "section" failed: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/baseof.html:5:17": execute of template failed: template: _default/list.html:4:7: executing "main" at <.Render>: error calling Render: "/opt/build/repo/content/blog/2022-installeer-het-homebrew-free-en-open-source-software-package-management-system-in-macos.md:5:17": failed to execute template ["content-list"] v: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/content-list.html:5:17": execute of template failed: template: _default/content-list.html:10:7: executing "_default/content-list.html" at <.Render>: error calling Render: "/opt/build/repo/content/blog/2022-installeer-het-homebrew-free-en-open-source-software-package-management-system-in-macos.md:5:17": failed to execute template ["stats"] v: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/stats.html:5:17": execute of template failed: template: _default/stats.html:5:17: executing "_default/stats.html" at <.>: range can't iterate over Podcast
ERROR 2022/02/17 21:18:19 render of "term" failed: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/baseof.html:5:17": execute of template failed: template: _default/list.html:4:7: executing "main" at <.Render>: error calling Render: "/opt/build/repo/content/blog/2022-installeer-het-homebrew-free-en-open-source-software-package-management-system-in-macos.md:5:17": failed to execute template ["content-list"] v: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/content-list.html:5:17": execute of template failed: template: _default/content-list.html:10:7: executing "_default/content-list.html" at <.Render>: error calling Render: "/opt/build/repo/content/blog/2022-installeer-het-homebrew-free-en-open-source-software-package-management-system-in-macos.md:5:17": failed to execute template ["stats"] v: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/stats.html:5:17": execute of template failed: template: _default/stats.html:5:17: executing "_default/stats.html" at <.>: range can't iterate over Podcast
ERROR 2022/02/17 21:18:19 render of "term" failed: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/baseof.html:5:17": execute of template failed: template: _default/list.html:4:7: executing "main" at <.Render>: error calling Render: "/opt/build/repo/content/blog/2022-installeer-het-homebrew-free-en-open-source-software-package-management-system-in-macos.md:5:17": failed to execute template ["content-list"] v: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/content-list.html:5:17": execute of template failed: template: _default/content-list.html:10:7: executing "_default/content-list.html" at <.Render>: error calling Render: "/opt/build/repo/content/blog/2022-installeer-het-homebrew-free-en-open-source-software-package-management-system-in-macos.md:5:17": failed to execute template ["stats"] v: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/stats.html:5:17": execute of template failed: template: _default/stats.html:5:17: executing "_default/stats.html" at <.>: range can't iterate over Podcast
ERROR 2022/02/17 21:18:19 render of "term" failed: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/baseof.html:5:17": execute of template failed: template: _default/list.html:4:7: executing "main" at <.Render>: error calling Render: "/opt/build/repo/content/blog/2022-installeer-het-homebrew-free-en-open-source-software-package-management-system-in-macos.md:5:17": failed to execute template ["content-list"] v: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/content-list.html:5:17": execute of template failed: template: _default/content-list.html:10:7: executing "_default/content-list.html" at <.Render>: error calling Render: "/opt/build/repo/content/blog/2022-installeer-het-homebrew-free-en-open-source-software-package-management-system-in-macos.md:5:17": failed to execute template ["stats"] v: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/stats.html:5:17": execute of template failed: template: _default/stats.html:5:17: executing "_default/stats.html" at <.>: range can't iterate over Podcast
Total in 682 ms
10:18:19 PM: Error: Error building site: failed to render pages: render of "page" failed: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/single.html:5:17": execute of template failed: template: _default/single.html:12:9: executing "main" at <.Render>: error calling Render: "/opt/build/repo/content/blog/2022-installeer-het-homebrew-free-en-open-source-software-package-management-system-in-macos.md:5:17": failed to execute template ["stats"] v: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/stats.html:5:17": execute of template failed: template: _default/stats.html:5:17: executing "_default/stats.html" at <.>: range can't iterate over Podcast
​
10:18:19 PM: ────────────────────────────────────────────────────────────────
10:18:19 PM:   "build.command" failed                                        
10:18:19 PM: ────────────────────────────────────────────────────────────────
10:18:19 PM: ​
10:18:19 PM:   Error message
10:18:19 PM:   Command failed with exit code 255: hugo --gc --minify
10:18:19 PM: ​
10:18:19 PM:   Error location
10:18:19 PM:   In build.command from netlify.toml:
10:18:19 PM:   hugo --gc --minify
10:18:19 PM: ​
10:18:19 PM:   Resolved config
10:18:19 PM:   build:
10:18:19 PM:     command: hugo --gc --minify
10:18:19 PM:     commandOrigin: config
10:18:19 PM:     environment:
10:18:19 PM:       - HUGO_VERSION
10:18:19 PM:       - HUGO_ENV
10:18:19 PM:       - HUGO_ENABLEGITINFO
10:18:19 PM:     publish: /opt/build/repo/public
10:18:19 PM:     publishOrigin: config
10:18:19 PM:   plugins:
10:18:19 PM:     - inputs: {}
10:18:19 PM:       origin: ui
10:18:19 PM:       package: '@netlify/plugin-sitemap'
10:18:19 PM:     - inputs: {}
10:18:19 PM:       origin: ui
10:18:19 PM:       package: netlify-plugin-submit-sitemap
10:18:20 PM: Caching artifacts
10:18:20 PM: Started saving build plugins
10:18:20 PM: Finished saving build plugins
10:18:20 PM: Started saving pip cache
10:18:20 PM: Finished saving pip cache
10:18:20 PM: Started saving emacs cask dependencies
10:18:20 PM: Finished saving emacs cask dependencies
10:18:20 PM: Started saving maven dependencies
10:18:20 PM: Finished saving maven dependencies
10:18:20 PM: Started saving boot dependencies
10:18:20 PM: Finished saving boot dependencies
10:18:20 PM: Started saving rust rustup cache
10:18:20 PM: Finished saving rust rustup cache
10:18:20 PM: Started saving go dependencies
10:18:20 PM: Finished saving go dependencies
10:18:20 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
10:18:20 PM: Creating deploy upload records
10:18:20 PM: Failing build: Failed to build site
10:18:20 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
10:18:20 PM: Finished processing build request in 23.680236326s

For this problem to be resolved it is possible to let the current situation remain for a while. The main website is still functioning. I hope the ERROR information gives enough details about what is going wrong. My current knowledge is not that detailed to be able to analyse and fix this myself. Any help is appreciated. Do you know how to approach this problem? Or maybe you can help me find somebody with the required in depth skills to help fix this? Thanks so much in advance.

If you can share your repository, I’ll have a look. Feel free to dm me or reach out on slack as I believe I responded to your question there as well.

Hello Tom, let me also thank you in advance for your response. Unfortunately I don’t know to share my repository. Could you perhaps show me in more detail how this is accomplished? A little manual with logic steps would be very much appreciated, is that possible?

Join me on Slack – it’s a faster, simpler way to work. Sign up here, from any device: Slack

If you’ve the repository on GitHub or a similar Git host, you could add one of us as a collaborator or share the link directly if it’s public.

My GitHub repository is:

You’ll have to set it to public in order for anyone to have a look

Sorry for that. Now it should be public.

I think the problem is because of multi-line strings: https://github.com/martijnvandenboom/backup-website/blob/main/content/blog/2022-installeer-het-homebrew-free-en-open-source-software-package-management-system-in-macos.md?plain=1#L2-L3. Would you try consolidating the title into 1 line?

Thank you for your effort to analyse the website. The steps I followed up on is deleting the old entry and added a blog entry with a short title that fitted on one line. But the deployment failed. Let me show you some more of the current details.

Deploy log:

6:14:07 PM: Build ready to start
6:14:09 PM: build-image version: 6ebfb829398e07eb99ad5455777162ff19838822 (xenial)
6:14:09 PM: build-image tag: v3.10.5
6:14:09 PM: buildbot version: 9bc48650b0551281ca8258d0c32d371dd2b6993b
6:14:09 PM: Fetching cached dependencies
6:14:09 PM: Starting to download cache of 161.5MB
6:14:10 PM: Finished downloading cache in 1.041122705s
6:14:10 PM: Starting to extract cache
6:14:14 PM: Finished extracting cache in 4.178431808s
6:14:14 PM: Finished fetching cache in 5.259361461s
6:14:14 PM: Starting to prepare the repo for build
6:14:15 PM: Preparing Git Reference refs/heads/main
6:14:16 PM: Parsing package.json dependencies
6:14:16 PM: Different build command detected, going to use the one specified in the Netlify configuration file: 'hugo --gc --minify' versus 'hugo' in the Netlify UI
6:14:16 PM: Starting build script
6:14:17 PM: Installing dependencies
6:14:17 PM: Python version set to 2.7
6:14:17 PM: Started restoring cached node version
6:14:20 PM: Finished restoring cached node version
6:14:21 PM: v12.18.0 is already installed.
6:14:21 PM: Now using node v12.18.0 (npm v6.14.4)
6:14:21 PM: Started restoring cached build plugins
6:14:21 PM: Finished restoring cached build plugins
6:14:21 PM: Attempting ruby version 2.7.1, read from environment
6:14:22 PM: Started restoring cached ruby version
6:14:22 PM: Finished restoring cached ruby version
6:14:25 PM: Using ruby version 2.7.1
6:14:25 PM: Using PHP version 5.6
6:14:25 PM: Installing Hugo 0.79.0
6:14:25 PM: Hugo Static Site Generator v0.79.0-1415EFDC/extended linux/amd64 BuildDate: 2020-11-27T09:16:17Z
6:14:25 PM: Started restoring cached go cache
6:14:25 PM: Finished restoring cached go cache
6:14:25 PM: go version go1.14.4 linux/amd64
6:14:25 PM: go version go1.14.4 linux/amd64
6:14:25 PM: Installing missing commands
6:14:25 PM: Verify run directory
6:14:27 PM: ​
6:14:27 PM: ────────────────────────────────────────────────────────────────
6:14:27 PM:   Netlify Build                                                 
6:14:27 PM: ────────────────────────────────────────────────────────────────
6:14:27 PM: ​
6:14:27 PM: ❯ Version
6:14:27 PM:   @netlify/build 26.3.3
6:14:27 PM: ​
6:14:27 PM: ❯ Flags
6:14:27 PM:   baseRelDir: true
6:14:27 PM:   buildId: 621276dfeb0364000716192a
6:14:27 PM:   deployId: 621276dfeb0364000716192c
6:14:27 PM: ​
6:14:27 PM: ❯ Current directory
6:14:27 PM:   /opt/build/repo
6:14:27 PM: ​
6:14:27 PM: ❯ Config file
6:14:27 PM:   /opt/build/repo/netlify.toml
6:14:27 PM: ​
6:14:27 PM: ❯ Context
6:14:27 PM:   production
6:14:28 PM: ​
6:14:28 PM: ❯ Loading plugins
6:14:28 PM:    - @netlify/plugin-sitemap@0.8.1 from Netlify app
6:14:28 PM:    - netlify-plugin-submit-sitemap@0.2.3 from Netlify app
6:14:30 PM: ​
6:14:30 PM: ────────────────────────────────────────────────────────────────
6:14:30 PM:   1. build.command from netlify.toml                            
6:14:30 PM: ────────────────────────────────────────────────────────────────
6:14:30 PM: ​
6:14:30 PM: $ hugo --gc --minify
6:14:30 PM: Start building sites …
6:14:31 PM: ERROR 2022/02/20 17:14:31 render of "section" failed: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/baseof.html:5:17": execute of template failed: template: _default/list.html:4:7: executing "main" at <.Render>: error calling Render: "/opt/build/repo/content/blog/2022-installeer-homebrew-op-macos.md:5:17": failed to execute template ["content-list"] v: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/content-list.html:5:17": execute of template failed: template: _default/content-list.html:10:7: executing "_default/content-list.html" at <.Render>: error calling Render: "/opt/build/repo/content/blog/2022-installeer-homebrew-op-macos.md:5:17": failed to execute template ["stats"] v: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/stats.html:5:17": execute of template failed: template: _default/stats.html:5:17: executing "_default/stats.html" at <.>: range can't iterate over Podcast
ERROR 2022/02/20 17:14:31 render of "term" failed: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/baseof.html:5:17": execute of template failed: template: _default/list.html:4:7: executing "main" at <.Render>: error calling Render: "/opt/build/repo/content/blog/2022-installeer-homebrew-op-macos.md:5:17": failed to execute template ["content-list"] v: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/content-list.html:5:17": execute of template failed: template: _default/content-list.html:10:7: executing "_default/content-list.html" at <.Render>: error calling Render: "/opt/build/repo/content/blog/2022-installeer-homebrew-op-macos.md:5:17": failed to execute template ["stats"] v: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/stats.html:5:17": execute of template failed: template: _default/stats.html:5:17: executing "_default/stats.html" at <.>: range can't iterate over Podcast
ERROR 2022/02/20 17:14:31 render of "term" failed: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/baseof.html:5:17": execute of template failed: template: _default/list.html:4:7: executing "main" at <.Render>: error calling Render: "/opt/build/repo/content/blog/2022-installeer-homebrew-op-macos.md:5:17": failed to execute template ["content-list"] v: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/content-list.html:5:17": execute of template failed: template: _default/content-list.html:10:7: executing "_default/content-list.html" at <.Render>: error calling Render: "/opt/build/repo/content/blog/2022-installeer-homebrew-op-macos.md:5:17": failed to execute template ["stats"] v: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/stats.html:5:17": execute of template failed: template: _default/stats.html:5:17: executing "_default/stats.html" at <.>: range can't iterate over Podcast
ERROR 2022/02/20 17:14:31 render of "term" failed: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/baseof.html:5:17": execute of template failed: template: _default/list.html:4:7: executing "main" at <.Render>: error calling Render: "/opt/build/repo/content/blog/2022-installeer-homebrew-op-macos.md:5:17": failed to execute template ["content-list"] v: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/content-list.html:5:17": execute of template failed: template: _default/content-list.html:10:7: executing "_default/content-list.html" at <.Render>: error calling Render: "/opt/build/repo/content/blog/2022-installeer-homebrew-op-macos.md:5:17": failed to execute template ["stats"] v: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/stats.html:5:17": execute of template failed: template: _default/stats.html:5:17: executing "_default/stats.html" at <.>: range can't iterate over Podcast
Total in 940 ms
6:14:31 PM: Error: Error building site: failed to render pages: render of "page" failed: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/single.html:5:17": execute of template failed: template: _default/single.html:12:9: executing "main" at <.Render>: error calling Render: "/opt/build/repo/content/blog/2022-installeer-homebrew-op-macos.md:5:17": failed to execute template ["stats"] v: "/opt/build/repo/themes/hugo-future-imperfect-slim/layouts/_default/stats.html:5:17": execute of template failed: template: _default/stats.html:5:17: executing "_default/stats.html" at <.>: range can't iterate over Podcast
​
6:14:31 PM: ────────────────────────────────────────────────────────────────
6:14:31 PM:   "build.command" failed                                        
6:14:31 PM: ────────────────────────────────────────────────────────────────
6:14:31 PM: ​
6:14:31 PM:   Error message
6:14:31 PM:   Command failed with exit code 255: hugo --gc --minify
6:14:31 PM: ​
6:14:31 PM:   Error location
6:14:31 PM:   In build.command from netlify.toml:
6:14:31 PM:   hugo --gc --minify
6:14:31 PM: ​
6:14:31 PM:   Resolved config
6:14:31 PM:   build:
6:14:31 PM:     command: hugo --gc --minify
6:14:31 PM:     commandOrigin: config
6:14:31 PM:     environment:
6:14:31 PM:       - HUGO_VERSION
6:14:31 PM:       - HUGO_ENV
6:14:31 PM:       - HUGO_ENABLEGITINFO
6:14:31 PM:     publish: /opt/build/repo/public
6:14:31 PM:     publishOrigin: config
6:14:31 PM:   plugins:
6:14:31 PM:     - inputs: {}
6:14:31 PM:       origin: ui
6:14:31 PM:       package: '@netlify/plugin-sitemap'
6:14:31 PM:     - inputs: {}
6:14:31 PM:       origin: ui
6:14:31 PM:       package: netlify-plugin-submit-sitemap
6:14:32 PM: Caching artifacts
6:14:32 PM: Started saving build plugins
6:14:32 PM: Finished saving build plugins
6:14:32 PM: Started saving pip cache
6:14:32 PM: Finished saving pip cache
6:14:32 PM: Started saving emacs cask dependencies
6:14:32 PM: Finished saving emacs cask dependencies
6:14:32 PM: Started saving maven dependencies
6:14:32 PM: Finished saving maven dependencies
6:14:32 PM: Started saving boot dependencies
6:14:32 PM: Finished saving boot dependencies
6:14:32 PM: Started saving rust rustup cache
6:14:32 PM: Finished saving rust rustup cache
6:14:32 PM: Started saving go dependencies
6:14:32 PM: Finished saving go dependencies
6:14:32 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
6:14:32 PM: Creating deploy upload records
6:14:32 PM: Failing build: Failed to build site
6:14:32 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
6:14:32 PM: Finished processing build request in 23.475020522s

Contents of the newly created blog entry *.md file:


title: Installeer homebrew op macOS
date: 2022-02-20T17:11:54.118Z
draft: false
categories: Podcast
tags:

  • Installeer
  • homebrew
  • macOS
    author: ing. M.A.C.M. (Martijn) van den Boom
    authorImage: uploads/Martijn_001.jpg
    comments: true
    share: true
    type: post

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Any ideas why this deployment attempt failed?

Hey @martijnvandenboom,

Oh, my bad. I cloned your repo locally and tried to debug this closely.

The problem is here:

https://github.com/martijnvandenboom/backup-website/blob/main/content/blog/2022-installeer-homebrew-op-macos.md?plain=1#L5

The theme that you’re using, expects Categories to be a map, but you’ve provided a string.

Changing it to:

categories:
  - Podcast

does the trick.

Oh that is great that you have pinned in down to this specific requirement. A real good achievement. Now the question to me arises how can I set this setting in the Netlify CMS environment so it will generate the proper format automatically?

Use the list widget to create arrays:

With my current knowledge I am not immediately aware of which file to edit or how and where to make the list change. Maybe you can give me a few hints more?

Change this:

- {label: "Categories", name: "categories", widget: "hidden", default: "Podcast"}

to this:

- label: "Categories"
  name: "categories"
  widget: "list"
  summary: '{{fields.category}}'
  field: {label: Category, name: category, widget: string}

You could change the lists’ field to a select widget as well, if you’d like to use predefined values:

- label: "Categories"
  name: "categories"
  widget: "list"
  summary: '{{fields.category}}'
  field: {label: Category, name: category, widget: select, options: ["podcast", "video", "article"]}

Or, if a list widget setup is to complex for your liking and you don’t want to use free text input, use a select widget with the multiple property set to true:

- label: "Categories"
  name: "categories"
  widget: "select"
  options: ["podcast", "video", "article"]
  multiple: true

Thank you gentlemen for helping me fix this issue. It is you who makes it possible and it is working now. My posts created with Netify CMS are now shown on my website. Thank you so much for your effort. It is highly appreciated.

1 Like