0

I am trying to hook up my Jekyll installation with NetlifyCMS. I am using a custom theme that works fine without the CMS part, however when I integrate as per the NetflifyCMS docs I get this error.

~/.rvm/gems/ruby-2.5.1/gems/jekyll-3.4.1/lib/jekyll/collection.rb:158:in `sanitize_label': undefined method `gsub' for #<Hash:0x00007fed774d2a3

I am running this on a Mac OSX and here is my config.yml is. The relevant section is the collection section:

collections:
  - name: 'docs'
    output: true
    label: 'Docs'
    folder: '_docs/'
    create: true
    slug: '{{year}}-{{month}}-{{day}}-{{slug}}'
    editor:
      preview: false
    fields:
      - { label: 'Layout', name: 'layout', widget: 'hidden', default: 'post' }
      - { label: 'Title', name: 'title', widget: 'string' }
      - { label: 'Publish Date', name: 'date', widget: 'datetime' }
      - { label: 'Body', name: 'body', widget: 'markdown' }
  - name: 'faqs'
    output: false
    label: 'Faqs'
    folder: '_faqs/'
    create: true
    slug: '{{year}}-{{month}}-{{day}}-{{slug}}'
    editor:
      preview: false
    fields:
      - { label: 'Layout', name: 'layout', widget: 'hidden', default: 'post' }
      - { label: 'Title', name: 'title', widget: 'string' }
      - { label: 'Publish Date', name: 'date', widget: 'datetime' }
      - { label: 'Body', name: 'body', widget: 'markdown' }
  - name: 'changelogs'
    output: false
  - name: 'blog'
    output: true
    label: 'Blog'
    folder: '_posts/'
    create: true
    slug: '{{year}}-{{month}}-{{day}}-{{slug}}'
    editor:
      preview: false
    fields:
      - { label: 'Layout', name: 'layout', widget: 'hidden', default: 'post' }
      - { label: 'Title', name: 'title', widget: 'string' }
      - { label: 'Publish Date', name: 'date', widget: 'datetime' }
      - { label: 'Body', name: 'body', widget: 'markdown' }
Rami Taibah
  • 183
  • 3
  • 13

1 Answers1

1

Found the problem. NetlifyCMS docs weren't so clear. These collections should have been put in the ./admin/config.yml and I was putting them in the main config.yml file.

Rami Taibah
  • 183
  • 3
  • 13