我正在运行一个集成了Netlify-CMS的Gridsome项目。这是我的config.yml文件的样子:
backend:
name: github
branch: master # Branch to update (optional; defaults to master)
repo: user/repo
media_folder: "images/uploads"
public_folder: "/images/uploads"
collections:
- name: "blog" # Used in routes, e.g., /admin/collections/blog
label: "Blog" # Used in the UI
folder: "blog" # The path to the folder where the documents are stored
create: true # Allow users to create new documents in this collection
slug: "{{year}}-{{month}}-{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
fields: # The fields for each document, usually in front matter
- {label: "Layout", name: "layout", widget: "hidden", default: "blog"}
- {label: "Title", name: "title", widget: "string"}
- {label: "Publish Date", name: "date", widget: "datetime"}
- {label: "Featured Image", name: "thumbnail", widget: "image"}
- {label: "Body", name: "body", widget: "markdown"}
- name: "projects" # Used in routes, e.g., /admin/collections/blog
label: "Projects" # Used in the UI
folder: "projects" # The path to the folder where the documents are stored
create: true # Allow users to create new documents in this collection
slug: "{{year}}-{{month}}-{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
fields: # The fields for each document, usually in front matter
- {label: "Layout", name: "layout", widget: "hidden", default: "blog"}
- {label: "Customer", name: "customer", widget: "string"}
- {label: "Activity", name: "activity", widget: "string"}
- {label: "Date", name: "date", widget: "datetime"}
- {label: "Link", name: "link", widget: "string"}
- {label: "Featured Image", name: "thumbnail", widget: "image"}
- {label: "Body", name: "body", widget: "markdown"}我可以在管理界面中看到博客和项目,但是当我点击项目集合时,它不会在指定的文件夹中显示我现有的.md文件。同时,当我尝试创建一个新项目时,它不会被添加,也不会显示错误消息。
使用博客集合,一切工作起来都很有魅力。
项目目录如下所示:

发布于 2019-02-18 23:55:38
没有可用作标识符的字段。现在,您必须有一个名为"title“的字段,或者将"identifier_field"设置为您想要使用的字段的名称。字段的值对于条目来说应该是唯一的,所以我猜给每个项目添加一个"title“可能是个不错的选择。
这应该有一个错误,如果你可以在GitHub中打开一个bug,我们可以调查一下。
https://stackoverflow.com/questions/54745271
复制相似问题