hexo 基本命令
下面是一些命令中的变量的
<title>为新建文章的标题[layout]为布局名称
新建文章
1 | |
如 scaffolds 目录下有 post.md 文件,则 hexo new post test 代表以 post.md 为模板创建标题为 test 的文章
此命令会在 source/_post 目录下新建一个名为 test.md 的文件,该文件的内容与 scaffolds 目录下的 post.md 相同
发布草稿
1 | |
如 source/_drafts 目录下有 test.md 文件,则 hexo publish post test 会将 test.md 这篇草稿文章发布
此命令会将 test.md 文件移动到 source/_posts 目录
新建布局
一键部署
本节讲解 hexo 如何一键部署到 GitHub 上
- 编辑
_config.yml文件 - 修改
deploy:部分的配置如下1
2
3
4deploy:
type: 'git'
repo: 'git@github.com:{你的GitHub名称}/{你的GitHub名称}.github.io.git'
branch: 'master' - 安装
hexo-deployer-git插件1
npm install hexo-deployer-git --save - 配置
git1
2git config --global user.email {你的邮箱}
git config --global user.name {name} - 配置 SSH 免密登录
- 部署
1
hexo deploy
hexo 基本命令
https://wuqin0202.github.io/2023/07/08/hexo/hexo基本命令/