【发布时间】:2021-02-27 03:51:00
【问题描述】:
当我将新图片添加到博客文章时,它会尝试在“blog/1_3azrmh3wkwrmepqn0w9bgw-1-.png”中查找图片
但它不存在,我在静态下设置了所有内容
NetlifyCMS 配置
backend:
name: git-gateway
branch: master
publish_mode: editorial_workflow
media_folder: '../assets/images'
public_folder: '/assets/images'
collections:
- name: 'blog'
label: 'Blog'
folder: 'packages/common/src/articles'
create: true
slug: 'index'
path: '{{title}}/index'
editor:
preview: true
fields:
- { label: 'Title', name: 'title', widget: 'string' }
- { label: 'Publish Date', name: 'date', widget: 'datetime' }
- { label: 'Description', name: 'description', widget: 'string' }
- { label: 'Slug', name: 'slug', widget: 'string'}
- { label: 'Tags', name: 'tags', add_to_top: true, minimize_collapsed: true, widget: 'list', field: {name: tag, label: Tag, widget: string} }
- { label: 'Keywords', name: 'keywords', widget: 'list', add_to_top: true, minimize_collapsed: true, field: {name: Keyword, label: keyword, widget: string} }
- label: 'Image'
name: 'image'
widget: 'object'
fields:
- label: ImageUrl
name: ImageUrl
widget: image
- label: ImageAlt
name: ImageAlt
widget: string
- { label: 'Body', name: 'body', widget: 'markdown' }
盖茨比配置
`gatsby-plugin-netlify-cms`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `articles`,
path: `../common/src/articles`
}
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `static/assets/images`
}
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `common-images`,
path: `static/assets/images`
}
},
不知道出了什么问题,但它正在将它们上传到错误的文件夹
【问题讨论】:
-
media_folder应该相对于 repo 的基础,您是否尝试删除../? -
到 repo 或 cofig yaml?
标签: gatsby netlify netlify-cms