-
Notifications
You must be signed in to change notification settings - Fork 0
使用 mirror 和 hugo 实现 github issue 的博客自动同步 #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
时隔大半年,github 私有项目都免费了,我的第一篇博客还没有写完。 真是要感叹一句,“时间都去哪了”. |
mirrormirror 通过 github 提供的 graphql 进行 Issues 内容抓取。 mirror 规则 mirror 配置文件mirror 的配置文件使用 yaml 格式, 参考 conf.yaml 配置文件中可定义多个内容来源。 每一种不同的内容来源,都有其具体的配置项。 内容来源 "issues" 具体的配置内容有
内容来源 Issue 的抓取规则
打开的Issue 视为博客草稿,不抓取。只抓取已经关闭的 Issue 内容。
issue 本身有 body 和 comment。 新建issue时的内容是body, 之后所有项目本人和其它 githuber 的追加的内容都是评论。 Mirror 支持将 Issue body 和 comment 都抓取下来余与body部分拼接合并作为完整博客内容。 由于 Issue 都是公开的,可能会被别人评论,作者还可能回复提问者。 |
hugohugo 是一个非常棒的静态页面生成器,可以把 markdown 内容,搭配各种主题生成你想要的静态博客内容。 这些内容托管在 github pages 上博客就部署好了。 |
完整步骤
如果有兴趣和精力,还可以用 github 提供的 webhooks,自行配置服务器并利用 hooks 自动触发这些过程的执行,可实现博客的自动更新。 |
一直觉得 Issue 是个特别好用的记录工具,看到很多人也直接把 Issue 作为个人博客。 Issue 可以碎片化的记录一些东西,然后在进行整理,最终形成一篇不错的博客内容。
Issue 适合记录博客,但我觉得直接以 Issue 的形式将内容展示给读者还是缺少了博客本来的样子。毕竟Issue不支持自定义主题。
我青睐的形式是:通过 Issue 进行写作,然后自动发布到博客站点。 所以就产生了 mirror 这个工具。
mirror 能够自动抓取 github 项目里的 issue,并输出为 hugo 支持的构建格式。 通过 hugo 自动生成静态网页,最终通过自动工具实现部署。
使用 github webhooks 以及很少的自动化脚本就可以实现这个过程的全自动化。
The text was updated successfully, but these errors were encountered: