所以我建立了一个主题为[Moon]的Jekyll网站(无法继续输入:TypeError:无法读取未定义的属性' sha'未定义)并且我已将其上传到我的GitHub repository。然后我想将Netlify的管理面板添加到我的网站,因此我按照this guide将config.yml
修改为以下代码:
backend:
name: git-gateway
publish_mode: editorial_workflow
media_folder: "files"
display_url: https://ccsource.org
slug:
encoding: "ascii"
clean_accents: true
collections:
- name: "story"
label: "Story"
folder: "_posts"
extension: "md"
slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
create: true
fields:
- {label: "Layout", name: "layout", widget: "hidden", default: "post"}
- {label: "Title", name: "title", widget: "string"}
- label: "tags"
name: "tags"
widget: "list"
allow_add: true
default: ["story"]
- {label: "Summary", name: "excerpt", widget: "string", required: false}
- {label: "comments", name: "comments", widget: "hidden", default: true}
- label: "Publish date"
name: "date"
widget: "datetime"
default: ""
format: "MMM Do YY"
- {label: "Body", name: "body", widget: "markdown", required: true}
因为我得到了降价样本文件,如:
---
layout: post
title: "Sample"
date: 2016-03-15
excerpt: "Hello..."
tag:
- sample
- post
- video
comments: true
---
# Sample
但是在设置和部署完所有内容之后,我访问了我的网站管理员面板并尝试创建新帖子,我一直收到以下错误。
Failed to persist entry: TypeError: Cannot read property 'sha' of undefined
我已经用Google搜索并将branch
值修改为与我的github存储库匹配的site
,但错误仍然显示,我该如何解决?
答案 0 :(得分:5)
对于遇到此问题的其他人来说,问题是Netlify身份已启用,但Netlify身份的子功能Git Gateway却没有。在此处启用Git Gateway的说明:https://www.netlify.com/docs/git-gateway/#getting-started