hexo 学习 0001:hexo博客项目 hexo-learn 操作记录

本文章记录了 hexo 博客项目 hexo-learn 的操作记录,包含了基础的 hexo 命令、安装、初始化、预览、生成、部署等操作。

安装 Hexo CLI

1
yarn global add hexo-cli

初始化博客项目

初始化博客项目 hexo-learn

1
hexo init hexo-learn

进入项目目录

1
cd hexo-learn

使用 Yarn 安装项目依赖

1
yarn

预览博客

启动本地服务器预览博客

1
hexo server

生成博客静态文件:

生成到当前目录 public 文件夹下:

1
hexo generate

清除已生成的文件

清除缓存文件 (db.json) 和已生成的静态文件 (public):

1
hexo clean

部署网站

1
hexo deploy

新建一篇博客文章

1
2
3
hexo new "文章标题"
hexo new post --path "categories/node-js/intro" "Node.js 入门"
hexo new hexol "0017-hexo-migration"