Bitbucket Failed to persist entry: API_ERROR: Branch not found

Bitbucket Failed to persist entry: API_ERROR: Branch not found

该网站是在 Bitbucket 中使用 Gatsby 和 Netlify CMS 构建的。当我尝试使用 Netlify CMS (Live) 更改自定义页面上的某些内容时出现错误,但在本地设置上运行完美。这让我很困惑,我不知道这是怎么回事,为什么会这样。

这是我的 config.yml

backend:
  name: bitbucket
  repo: repo-name
  branch: master
  auth_type: implicit
  app_id: app-id
  commit_messages:
    create: "Create {{collection}} “{{slug}}”"
    update: "Update {{collection}} “{{slug}}”"
    delete: "Delete {{collection}} “{{slug}}”"
    uploadMedia: "[skip ci] Upload “{{path}}”"
    deleteMedia: "[skip ci] Delete “{{path}}”"

local_backend: true
publish_mode: editorial_workflow
media_folder: static/img
public_folder: /img

(因为太长略过一些,这里是自定义页面的设置)

- name: "pages"
    label: "Pages"
    label_singular: "Page"
    create: true
    files:
  - file: "src/pages/resources/i-mop-xl-operator-resources.md"
    label: "i-mop xl operator resources"
    name: "i-mop xl operator resources"
    fields:
      - {
          label: "Template Key",
          name: "templateKey",
          widget: "hidden",
          default: "i-mop-xl-operator-resources",
        }
      - { label: Title, name: title, widget: string }
      - { label: Heading, name: heading, widget: string }
      - { label: Description, name: description, widget: string }
      - {
          label: "Seo Description",
          name: "seodescription",
          widget: "string",
        }
      - { label: "Seo Keyword", name: "seokeyword", widget: "string" }
      - {
          label: "Seo Title",
          name: "seotitle",
          widget: "string",
          required: false,
        }

错误是说

P.S这只发生在我创建的新页面上。

所以我找到了解决这个问题的方法,我认为它非常简单。名称不能有空格 space。 来自:

- file: "src/pages/resources/i-mop-xl-operator-resources.md"
  label: "i-mop xl operator resources"
  name: "i-mop xl operator resources"

为此:

- file: "src/pages/resources/i-mop-xl-operator-resources.md"
  label: "i-mop xl operator resources"
  name: "i-mop-xl-operator-resources"