如何在 Netlify CMS 中添加图片上传功能

How to add image upload functionality in Netlify CMS

嗨,我是 Netlify CMS 的新手,我刚刚从博客上了解到它

所以我 config.yml 在 Netlify CMS 中创建了两个输入字段 示例:

collections:
  - name: 'team'
    label: 'Team'
    folder: 'src/team'
    create: true
    slug: '{{slug}}'
    fields:
      - { label: 'Team Member', name: 'title', widget: 'string' }
      - { label: 'Bio', name: 'bio', widget: 'markdown' }

我只是想知道如何为图像添加输入字段

谢谢!

只需添加

{ label: "Image", name: "thumbnail", widget: "image"}

进入你的领域之一

collections:
  - name: 'team'
    label: 'Team'
    folder: 'src/team'
    create: true
    slug: '{{slug}}'
    fields:
      - { label: 'Team Member', name: 'title', widget: 'string' }
      - { label: 'Bio', name: 'bio', widget: 'markdown' }
      - { label: "Image", name: "thumbnail", widget: "image"}

来源:https://www.netlifycms.org/docs/add-to-your-site/