这是我config.yml中有关NetlifyCMS的相关部分,在这里我想使用Uploadcare的图像小部件为画廊选择多个图像:
media_library:
name: uploadcare
config:
publickey: mypublicapikey
media_folder: "/src/images/"
public_folder: "/src/images/"
collections:
- label: "Projects"
name: "projects"
folder: "src/data/projects"
media_folder: 'images'
media_library:
name: uploadcare
config:
publickey: mypublicapikey
fields: # The fields for each document, usually in front matter
- {label: "Image", name: "image", widget: "image", allow_multiple: false}
- label: "Gallery Images"
name: "images"
widget: "image"
options:
media_library:
config:
multiple: true
previewStep: false
这将导致一个小部件,其中我只能选择一张图像。我试过了shift / ctrl / ctrl + shift点击其他条目,但没有用。文档说默认允许多张图片,但这不是我遇到的问题。
答案 0 :(得分:0)
要使Uploadcare正常工作,您可能需要为netlify-cms安装uploadcare插件:
npm i netlify-cms-media-library-uploadcare --save
我遵循发布于here的解决方案进行了分解:
import CMS from 'netlify-cms-app'
import uploadcare from 'netlify-cms-media-library-uploadcare';
CMS.registerMediaLibrary(uploadcare);
然后按照docs进行Uploadcare。