cdlug / cdlug.github.io

Website of Chengdu GNU/Linux User Group
https://cdlug.org
Creative Commons Attribution Share Alike 4.0 International
6 stars 3 forks source link

基于 Git 的MarkDown blog 系统 draft #21

Open haobug opened 4 years ago

haobug commented 4 years ago

origniated by @rexzhang

基于 Git 的MarkDown blog 系统

CI 不能搞定用webhook ?

分支

gh-pages 作为发布的 html master 为主分支

目录

所有新增文件在 draft 目录 CI 调整过的 markdown 文件在 post 目录 CI 调整过的附件在 xxx? 目录

流程

draft 流程

创建 markdown 文件,文件名随意 其他为附件,文件名随意

publish 流程

一个 markdown 生成一个 post id CI 自动改文件名等 输出到目录 post picture

delete 流程

手动删除 post 文件,CI自动检测孤儿附件 或者 某个配置文件包含 post id

unpublished流程

某个配置文件里面包含需要 unpublished 的post id

update 流程

published/unpublished

直接修改 post 目录内的 markdown 文件 新增附件在 xxx?目录

haobug commented 4 years ago

(分片阅读)

CI 不能搞定用webhook ?

webhook 不是最后的稻草,我见有人用 webhook 把 gerrit 玩费了。

haobug commented 4 years ago

分支 gh-pages 作为发布的 html master 为主分支

master 里面放的 md 最好可以在线预览,是不是 md 本来存在有一个最小子集。有的话大家都用最小子集的特性。

(其实我是 md 的不爱好者,我保留我的观点有机会说)

haobug commented 4 years ago

所有新增文件在 draft 目录 CI 调整过的 markdown 文件在 post 目录 CI 调整过的附件在 xxx? 目录

直接一起放 post 里面吧,这样放文章和附件(比如图片)的相对路径很简朴。 方便有人 wget 到本地看,直接 ctrl-S 保持全部网页时候,不至于找不到资源。 请理解我这样的离线安全感的。但这样的配置可以让我们在废土之下,边缘星球,也能看上内容。


update 流程 published/unpublished 直接修改 post 目录内的 markdown 文件 新增附件在 xxx?目录

同前新增更新都放在 post 目录,

haobug commented 4 years ago

draft 流程 创建 markdown 文件,文件名随意 其他为附件,文件名随意

文件名不要随意,多个操作系统(shell,文件管理器)可用文件名不一样。 具体就参考已经有的引擎他们的可用字符集合。

附件就放进 md 文件同名的文件夹中,像下面这样,

post/sample_post.md
post/sample_post/attach1.zip
post/sample_post/titlepic.png
haobug commented 4 years ago

delete 流程 手动删除 post 文件,CI自动检测孤儿附件 或者 某个配置文件包含 post id

post/sample_post.mdpost/sample_post/ 一起删除

haobug commented 4 years ago

publish 流程 一个 markdown 生成一个 post id CI 自动改文件名等 输出到目录 post picture

这条没有看懂。

haobug commented 4 years ago

unpublished流程 某个配置文件里面包含需要 unpublished 的post id

不用配置文件,不用 post id,避免使用各种数据库; 直接基于文件名,使用文件系统管理。

unpublished 目录内部组织和 post 文件夹一样。 unpublished 目录名称建议直接使用 draft