Hello World

快速开始

配置环境

Git 官网

输入以下命令,若显示版本号则表示安装成功。

1
git --version

Node.js 官网

输入以下命令,若显示版本号则表示安装成功。

1
2
node -v
npm -v

初始化 Hexo

1
cd blog
1
npm install hexo-cli -g
1
hexo init

生成页面

1
hexo generate

本地预览

1
hexo server

常用命令

创建新文章

1
hexo new post "post name"

创建新页面

1
hexo new page "page name"

创建新草稿

1
hexo new draft "post name"

草稿转为文章

1
hexo publish "post name"

清除缓存文件

1
hexo clean

生成静态页面

1
hexo generate

本地运行调试

1
hexo server

部署到服务器

1
hexo deploy

一键三连

本地运行调试

1
hexo clean && hexo generate && hexo server

部署到服务器

1
hexo clean && hexo generate && hexo deploy

编写脚本

新建 txt文本文件,将后缀改为 .sh.bat,编写如下代码:

一键本地运行调试

1
2
3
@echo off
cd E:\blog
hexo clean && hexo generate && hexo server

一键部署到服务器

1
2
3
@echo off
cd E:\blog
hexo clean && hexo generate && hexo deploy

版权声明

本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 协议 ,转载请注明出处!


Hello World
https://www.xukaiyyds.cn/posts/83dcefb7/
作者
xukai
发布于
2020年10月16日
更新于
2023年3月31日
许可协议