Hexo-tools 常用脚本 发布 清理 新建

2019-01-25 09:49:06 +08:00
 Raphael96

前置背景

用 hexo 配合 Github Pages 写博客,但是经常会有在不同设备上发布的需要,就用 Onedrive 来做文件的同步和备份。但是 Hexo 每次 Deployed 之后都会生成一个 .deploy_git 的文件夹,Onedrive 在同步的时候需要对比很久,于是就想写个脚本每次发布之后清理一下。

脚本内容

发到 Github 了,但是其实内容很简单,懒得看的我就直接贴出来了。

https://github.com/raphaelli/hexo_tool

大家要是有其他的脚本可以 PR

# 清理
hexo clean && rm ./.deploy_git -rf && echo "Clean Finished !" && echo "press any key to quit!" && read

# 发布后清理
hexo g -d && echo "G-D Finished !" && hexo clean && rm ./.deploy_git -rf && echo "Clean Finished !" && echo "press any key to quit!" && read

# 新建文章并使用 VSCODE 打开
echo "Please input the article name:" && read name && echo "log:hexo new" $name && hexo new $name && echo $name" add completed !" && code "./source/_posts/"$name".md" && read

确实是很简单的脚本,大佬们勿喷,也就是偷个懒的功夫。

斗胆留下博客地址 https://ns96.com

1479 次点击
所在节点    Blogger
4 条回复
mafeifan
2019-01-25 11:44:00 +08:00
访问速度挺快的,用的什么主机
Raphael96
2019-01-29 12:57:05 +08:00
@mafeifan 就是 github pages 啊 上了 腾讯云的 CDN
akira
2019-01-30 22:44:35 +08:00
tx 的 cdn 需要备案么
Raphael96
2019-01-31 12:01:59 +08:00
@akira 需要的,不过挺方便的,如果目的是国内访问和使用,备个案也没什么。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/530466

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX