使用 Git 网关配置 Netlify CMS 时出现问题

Problem with configuring Netlify CMS with Git Gateway

我正在尝试将此 Gatsby 启动程序与 Netlify CMS 一起使用。 https://github.com/stackrole-dev/gatsby-starter-foundation

我完全按照说明操作,但在启用 Git 网关后,当我尝试以管理员身份登录时遇到此错误消息。

Your Git Gateway backend is not returning valid settings. Please make sure it is enabled.

我不知道为什么它不起作用。

我的config.yml

backend:
  name: git-gateway
  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 # run npx netlify-cms-proxy-server for local testing

media_folder: "static/assets" 
public_folder: "/assets" 

collections:

您需要在 Netlify 中启用 git-gateway 和外部提供商的设置,如 Netlify documentation 所示:

此配置可以在https://app.netlify.com/sites/YOURNAME/settings/identity

下找到

此外,您的config.yml还缺少:

backend:
  name: git-gateway
  repo: username/repository
  branch: master

注意:将 usernamerepository 更改为您的姓名。

您可以启用git-gateway

设置 > 身份 > 服务