我按照官方指示做的,添加staticmanapp
为Collaborators
输入地址显示为 OK。
然后上传staticman.yml
到我 hexo 所在github repositories
所在根目录。
然后按照官方指示添加from
<form method="POST" action="https://api.staticman.net/v2/entry/github-username/github-repositories/comment">
<input name="<%- url_for(post.path) %>" type="hidden" value="github repositories">
//<%- url_for(post.path) %>是当前文章地址,我使用了 hexo-addrlink 插件所以都是‘/数字 ID/’
//github-username 和 github-repositories 是我的相关 github 信息,因为是单机所以不写具体的了
<!-- e.g. "2016-01-02-this-is-a-post" -->
<input name="options[slug]" type="hidden" value="<%- url_for(post.path) %>">
<label><input name="fields[name]" type="text">Name</label>
<label><input name="fields[email]" type="email">E-mail</label>
<label><textarea name="fields[message]"></textarea>Message</label>
<button type="submit">Go!</button>
</form>
comments:
allowedFields: ["name", "email", "url", "message"]
branch: "master"
commitMessage: "Add Staticman data"
filename: "entry{@timestamp}"
format: "yaml"
generatedFields:
date:
type: date
options:
format: "timestamp-seconds"
moderation: true
name: "eduardoboucas.com"
path: "comment/{options.slug}"
requiredFields: ["name", "email", "message"]
transforms:
email: md5
安装 staticman 我只做到
git clone git@github.com:eduardoboucas/staticman.git
cd staticman
npm install
跳过了cp config.sample.json config.development.json
进行到npm start
这里出错了,不知道啥原因(不知道和这个有啥关系没有)
目前一点击 GO (提交评论)就提示
{"success":false,"rawError":{"code":404,"status":"Not Found","message":"{\"message\":\"No commit found for the ref comment\",\"documentation_url\":\"https://developer.github.com/v3/repos/contents/\"}"},"errorCode":"GITHUB_READING_FILE"}
请问怎么回事?该如何解决,希望知道解决方法的人能够给予帮助,非常感谢!~
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.