前言
谁不想要一个有趣的blog呢~~
环境&工具
- ubuntu-22.04(wsl) 【18与20LTS可能出现npm安装问题 未找到解决方案】
- github
- node.js npm git hexo
GitHub仓库配置
- 创建一个仓库 名为
user/user.github.io 注:需要是public的仓库
- 在仓库主页->
settings->pages->branch 当中选取main作为展示分支
环境配置
1 2
| sudo apt install nodejs npm git npm install hexo-cli -g
|
HEXO使用
hexo初始化
主题配置
可以访问 https://hexo.io/themes/ 获取主题
1 2 3
| git clone https://github.com/iJinxin/hexo-theme-sky themes/sky vim _config.yml npm install hexo-renderer-scss --save
|
检视与上传
1 2
| hexo -s npm install hexo-deployer -git --save
|
添加以下内容
1 2 3 4 5
| deploy: type: git repository: git@bxhsiman.github.io ... branch: main
|
1 2
| hexo generate hexo deploy
|
访问 https://user.github.io 检查
编辑 发布博客
1 2 3 4
| hexo new "my newpost" vim $blog$/source/_posts/my newpost.md hexo generate hexo deploy
|
More info: hexo