Liam0205 / liam0205.github.io

Deployment of my weblog.
https://liam0205.github.io
35 stars 5 forks source link

在 hexo new 之后立即打开新建的 Markdown 文稿 | 始终 #74

Open Liam0205 opened 5 years ago

Liam0205 commented 5 years ago

https://liam.page/2015/05/01/open-editor-after-hexo-new-immediately/

自己的博客是用 Hexo 搭建的。Hexo 是其时尚为大学生的台湾人 Tommy 开发的轻量级静态博客生成器,具有简洁、快速、扩展性好等特点。 在 Hexo 中新建一篇博文非常简单,只需要在命令行中执行 hexo new "the title of your blog" 即可。Hexo 会在后台自动帮你创建名为 yyyy-mm-dd-the-title-of-your-blog

SaulJWu commented 4 years ago

不行呢

Nuevo009 commented 2 years ago

也可以在profile里面写个函数,Windows可以用powershell的profile,比如在windows下可以这么写,用hexo new生成新文件后,用vscode打开_posts目录下最近5s内新建的文件

function hexoNew {
    param (
        [Object]$name
    )
    Set-Location path/to/your/hexo_blog_repo ; hexo new $name ; Set-Location ./source/_posts
    $new = Get-ChildItem | Where-Object { $_.CreationTime -gt (Get-Date).AddSeconds(-5) } | ForEach-Object {$_.Name} 
    code ./$new
}

*nix 用户可以稍微改改,也不难