【发布时间】:2020-07-24 11:57:02
【问题描述】:
环境
- Netlify CMS 版本:netlify-cms-app@2.12.17
- Git 提供者:git-gateway
- 浏览器版本:Mozilla/5.0(Macintosh;Intel Mac OS X 10_11_6) AppleWebKit/537.36(KHTML,如 Gecko)Chrome/84.0.4147.89 Safari/537.36
说明
正如您在下面看到的,代码大部分都有效,但特别是在 CMS 的预览窗格中,当我添加 group 元素(列表)时,由于某种原因它会中断。我注意到这个问题发生在custom preview template 和this line 中,但我看不到那里有任何问题。有没有可能的解决办法?
添加 subgroup 元素(嵌套列表)时 - 它按预期工作
代码
我只用所需的代码创建了this public repo,因此任何人都可以轻松复制。 你也可以看这个网站here。
config.yml
publish_mode: simple
slug:
encoding: unicode
clean_accents: false
sanitize_replacement: "-"
backend:
name: git-gateway
branch: master
media_folder: static/images
public_folder: /images
collections:
- name: pages
label: Pages
files:
- file: src/pages/index.md
label: Index
name: index
fields:
- label: Groups
name: groups
widget: list
fields:
- label: Title
name: title
widget: string
- label: Subgroups
name: subgroups
widget: list
fields:
- label: Subtitle
name: subtitle
widget: string
publish: true
sortableFields:
- commit_date
- commit_author
view_filters: []
【问题讨论】:
标签: javascript reactjs netlify netlify-cms