V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Raphael96
V2EX  ›  Blogger

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

  •  
  •   Raphael96 · 2019-01-25 09:49:06 +08:00 · 1346 次点击
    这是一个创建于 1911 天前的主题,其中的信息可能已经有所发展或是发生改变。

    前置背景

    用 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

    4 条回复    2019-01-31 12:01:59 +08:00
    mafeifan
        1
    mafeifan  
       2019-01-25 11:44:00 +08:00 via Android
    访问速度挺快的,用的什么主机
    Raphael96
        2
    Raphael96  
    OP
       2019-01-29 12:57:05 +08:00
    @mafeifan 就是 github pages 啊 上了 腾讯云的 CDN
    akira
        3
    akira  
       2019-01-30 22:44:35 +08:00
    tx 的 cdn 需要备案么
    Raphael96
        4
    Raphael96  
    OP
       2019-01-31 12:01:59 +08:00
    @akira 需要的,不过挺方便的,如果目的是国内访问和使用,备个案也没什么。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5514 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 03:05 · PVG 11:05 · LAX 20:05 · JFK 23:05
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.