使用hexo创建博客
搭建博客
环境
Windows子系统(Arch)安装hexo
1
2
3
4
5
6
7安装
sudo pacman -S nodejs
sudo pacman -S npm
npm install -g hexo-cli --registry=https://registry.npmmirror.com
测试
hexo -vGitHub创建用户名.github.io仓库
设置密钥
1
2
3sudo pacman -S openssh
ssh-keygen -t rsa -C "924084608@qq.com"
cat .ssh/id_rsa.pub将密钥添加至GitHub
验证是否成功添加
1
ssh -T git@github.com
本地部署
1
2
3
4
5
6
7
8cd /mnt/d/92408/Documents/Blog/
npx hexo init 初始化
npx hexo install 安装
hexo new "My New Post" 创建文章
npx hexo clean 清理缓存
npx hexo g 生成
npx hexo d 上传
npx hexo s 本地部署上线博客
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15vim _config.yml
# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
type: git
repository: git@github.com:xinxiaoyu1/xinxiaoyu1.github.io.git
branch: main
git config --global user.email "924084608@qq.com"
git config --global user.name "xinxiaoyu1"
npx hexo d
遇到报错请安装hexo-deployer-git插件:## ERROR Deployer not found: git
npm install hexo-deployer-git --save --registry=https://registry.npmmirror.com
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 小雨的小窝!