hexo创建文件自动打开

如何在hexo创建新post文档之后自动打开

1
hexo n "The title of your blog"

这个指令可以快速创建

实现创建后自动打开

  1. 新建scripts目录(hexo根目录)

  2. 创建auto_open.js文件,如下

    1
    2
    3
    4
    5

    var spawn = require('child_process').exec;
    hexo.on('new', function(data){
    spawn('start "C:\Program Files\Typora\Typora.exe" ' + data.path);
    });

路径设置为你的软件路径即可

Donate
  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
  • Copyrights © 2023 Langxecho
  • Visitors: | Views:

请我喝杯咖啡吧~

支付宝
微信