嗨,我正在使用gatsby-starter-netlify-cms并设置了一个名为“Bios”的辅助博客或添加内容管理器正确显示的新生物但是当我按下发布时它从未真正发布更改(绿线永远消失......)
控制台显示: “未捕获(承诺中)错误:集合必须具有一个有效条目标识符的字段名称,或者必须设置 identifier_field”
回购位于https://github.com/theMakersOrg/theMakersWebsiteV2
这是我的 config.yaml 中的代码
backend:
name: git-gateway
branch: master
media_folder: static/img
public_folder: /img
collections:
- name: 'blog'
label: 'Blog'
folder: 'src/pages/blog'
create: true
slug: '{{year}}-{{month}}-{{day}}-{{slug}}'
fields:
- {
label: 'Template Key',
name: 'templateKey',
widget: 'hidden',
default: 'blog-post',
}
- { label: 'Title', name: 'title', widget: 'string' }
- { label: 'Publish Date', name: 'date', widget: 'datetime' }
- { label: 'Description', name: 'description', widget: 'text' }
- { label: 'Body', name: 'body', widget: 'markdown' }
- { label: 'Tags', name: 'tags', widget: 'list' }
- name: 'bios'
label: 'Bio'
folder: 'src/pages/bios'
create: true
slug: '{{year}}-{{month}}-{{day}}-{{slug}}'
fields:
- {
label: 'Template Key',
name: 'templateKey',
widget: 'hidden',
default: 'bio-post',
}
- { label: 'Name', name: 'name', widget: 'string' }
- { label: 'Publish Date', name: 'publishDate', widget: 'datetime' }
- { label: 'Description', name: 'description', widget: 'text' }
- { label: 'image', name: 'image1', widget: 'image' }
- { label: 'Body', name: 'body', widget: 'markdown' }
- { label: 'Tags', name: 'tags', widget: 'list' }
- name: 'pages'
label: 'Pages'
files:
- file: 'src/pages/about/index.md'
label: 'About'
name: 'about'
fields:
- {
label: 'Template Key',
name: 'templateKey',
widget: 'hidden',
default: 'about-page',
}
- { label: 'Title', name: 'title', widget: 'string' }
- { label: 'Body', name: 'body', widget: 'markdown' }
- file: 'src/pages/products/index.md'
label: 'Products Page'
name: 'products'
fields:
- {
label: 'Template Key',
name: 'templateKey',
widget: 'hidden',
default: 'product-page',
}
- { label: Title, name: title, widget: string }
- { label: Image, name: image, widget: image }
- { label: Heading, name: heading, widget: string }
- { label: Description, name: description, widget: string }
- {
label: Intro,
name: intro,
widget: object,
fields:
[
{ label: Heading, name: heading, widget: string },
{ label: Description, name: description, widget: text },
{
label: Blurbs,
name: blurbs,
widget: list,
fields:
[
{ label: Image, name: image, widget: image },
{ label: Text, name: text, widget: text },
],
},
],
}
- {
label: Main,
name: main,
widget: object,
fields:
[
{ label: Heading, name: heading, widget: string },
{ label: Description, name: description, widget: text },
{
label: Image1,
name: image1,
widget: object,
fields:
[
{ label: Image, name: image, widget: image },
{ label: Alt, name: alt, widget: string },
],
},
{
label: Image2,
name: image2,
widget: object,
fields:
[
{ label: Image, name: image, widget: image },
{ label: Alt, name: alt, widget: string },
],
},
{
label: Image3,
name: image3,
widget: object,
fields:
[
{ label: Image, name: image, widget: image },
{ label: Alt, name: alt, widget: string },
],
},
],
}
- {
label: Testimonials,
name: testimonials,
widget: list,
fields:
[
{ label: Quote, name: quote, widget: string },
{ label: Author, name: author, widget: string },
],
}
- { label: Full_image, name: full_image, widget: image }
- {
label: Pricing,
name: pricing,
widget: object,
fields:
[
{ label: Heading, name: heading, widget: string },
{ label: Description, name: description, widget: string },
{
label: Plans,
name: plans,
widget: list,
fields:
[
{ label: Plan, name: plan, widget: string },
{ label: Price, name: price, widget: string },
{
label: Description,
name: description,
widget: string,
},
{ label: Items, name: items, widget: list },
],
},
],
}