Hi,
I’m running into an error that I can’t quite figure out. I have posts and pages configured as folder collections on a Jekyll site.
I can delete posts, but I can’t delete pages. When I hit delete on a page, I get “Failed to delete entry: API_ERROR: path cannot start with a slash”
My hunch is that it’s related to the pages collection existing in the root folder, while posts are in a subdirectory. But I’m stuck there.
Here is my config.yml
for both collections:
collections:
- name: 'newsletter'
label: 'Posts'
label_singular: 'Post'
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: 'Tags', name: 'tags', widget: 'string', required: false }
- { label: 'Featured Image', name: 'featured_image', widget: 'image', required: false }
- { label: 'Featured', name: 'featured', widget: 'boolean', default: false, required: false }
- { label: 'Hidden', name: 'hidden', widget: 'boolean', default: false, required: false }
- { label: 'Author', name: 'author', widget: 'relation', collection: 'author_information', file: 'authors', valueField: 'items.*.display_name', searchFields: ['items.*.display_name', 'items.*.name'], displayFields: ['items.*.name'], required: false }
- { label: 'Publish Date', name: 'date', widget: 'datetime', required: true }
- { label: 'Body', name: 'body', widget: 'markdown', required: true }
- { label: 'Meta Description', name: 'description', widget: 'string', required: false, pattern: ['.{1,180}', 'Must have between 1 and 180 characters'] }
- { label: 'Meta Image', name: 'image', widget: 'image', required: false }
- name: 'pages'
label: 'Pages'
label_singular: 'Page'
folder: ''
create: true
slug: '{{slug}}'
filter: {field: 'layout', value: 'page'}
editor:
preview: false
fields:
- { label: 'Layout', name: 'layout', widget: 'hidden', default: 'page' }
- { label: 'Title', name: 'title', widget: 'string' }
- { label: 'Featured Image', name: 'featured_image', widget: 'image', required: false }
- { label: 'Body', name: 'body', widget: 'markdown', required: true }
- { label: 'Meta Description', name: 'description', widget: 'string', required: false, pattern: ['.{1,180}', 'Must have between 1 and 180 characters'] }
- { label: 'Meta Image', name: 'image', widget: 'image', required: false }
And the versions shown in browser logs:
netlify-cms-app 2.12.19
netlify-cms-core 2.30.3
netlify-cms 2.10.55
The offending part of the request url appears to be: …netlify.app/.netlify/git/github/contents//example-page.md?sha=…
Has anyone encountered this before?