Setting up a commit message for Netlify CMS

Hello!

I am configuring a documentation website with Netlify CMS and Docusaurus. Everything works fine when I publish a page through code, however, when I do it through CMS, Netlify creates really long commit messages including there every possible field from the created page (see the pic). I tried to configure it through config.yml (see the pic), but it doesn’t work. What can be the reason for this behaviour?

Deployed website

Config.yml

backend:
name: git-gateway
branch: master
commit_messages:
create: Create {{collection}} “{{slug}}”
update: Update {{collection}} “{{slug}}”
delete: Delete {{collection}} “{{slug}}”
uploadMedia: Upload “{{path}}”
deleteMedia: Delete “{{path}}”

media_folder: static/img
public_folder: static/img

collections:

  • name: ‘docs’
    label: ‘Docs’
    label_singular: ‘Doc’
    folder: ‘docs’
    extension: md
    widget: list
    create: true
    fields:
    • {label: ‘Name’, name: ‘name’}
    • {label: ‘Menu’, name: ‘menu’, required: false}
    • {label: ‘Body’, name: ‘body’, widget: ‘markdown’}

You need to configure the slug for that collection - it will default to identifier_field.

1 Like

Thank you @bmackinney ! I managed to fix it and the working config looks like that

backend:
name: git-gateway
branch: master
commit_messages:
create: Create {{collection}} “{{slug}}”
update: Update {{collection}} “{{slug}}”
delete: Delete {{collection}} “{{slug}}”
uploadMedia: Upload “{{path}}”
deleteMedia: Delete “{{path}}”

media_folder: static/img
public_folder: static/img

collections:

  • name: ‘docs’
    label: ‘Docs’
    label_singular: ‘Doc’
    folder: ‘docs’
    extension: md
    widget: list
    create: true
    slug: ‘{{slug}}’
    identifier_field: name
    fields:
    • {label: ‘Name’, name: ‘name’}
    • {label: ‘Menu’, name: ‘menu’, required: false}
    • {label: ‘Body’, name: ‘body’, widget: ‘markdown’}
1 Like