Skip to content
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

利用 GitHub Issues 持续写博灌水 #12

Open
ferstar opened this issue Jan 2, 2020 · 2 comments
Open

利用 GitHub Issues 持续写博灌水 #12

ferstar opened this issue Jan 2, 2020 · 2 comments
Labels

Comments

@ferstar
Copy link
Owner

@ferstar ferstar commented Jan 2, 2020

如题,有好的想法随时开issue写一发,然后借助CI自动把同一issue下的comments都拼接到一起,生成post

每次想到什么写什么,不论多少,没有一定要写完的压力,日积月累,应该会能形成一些起码篇幅不小的博文,想想都好激动的说。

@ferstar ferstar added Git Idea labels Jan 2, 2020
@ferstar

This comment has been minimized.

Copy link
Owner Author

@ferstar ferstar commented Jan 2, 2020

基本思路就是:

  1. 新建一个issue,或者评论一个issue
  2. 触发一个issue event
  3. 利用webhook将这个event推送到vps
  4. 解析event中的issue id
  5. 通过issue id调用github api获得issue及comments正文
  6. 拼装成hugo post
  7. 提交到blog repo
  8. 触发push event
  9. vps收到push event后拉取blog repo最新提交
  10. 调用hugo命令重新生成blog页面

其实就是issue+comments到hugo post的一个转换过程,对应关系如下:

issue label --> hugo tags
issue + comments --> hugo article(post)
issue create date --> hugo post time
issue or comments update date --> hugo post update date
comments --> hugo post comments

1需要人肉参与外,剩余流程都可以自动进行,也即所谓的CI(实现这样一个流程想想其实还是有一定的技术门槛的)

@ferstar ferstar changed the title 使用 GitHub Issues 进行持续博客写作 利用 GitHub Issues 持续写博灌水 Jan 2, 2020
@ferstar

This comment has been minimized.

Copy link
Owner Author

@ferstar ferstar commented Jan 3, 2020

整个流程详解及代码待续

@ferstar ferstar added the TODO label Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.