** 先安装个扩展$ npm install hexo-deployer-git --save
**
_config_yml
文件# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repo: git@github.com:yeshan333/yeshan333.github.io.git # 这个可到Github仓库拿
branch: master
ssh-keygen -t rsa -C "邮件地址@youremail.com" #生成新的key文件,邮箱地址填注册Github时用的
** 这里用到.ssh目录下,id_rsa.pub文件中的那串key**
ssh -T git@github.com
git config --global user.name "你的名字" # github用户名
git config --global user.email "邮箱@邮箱.com" # github邮箱
hexo g # 生成静态文件
hexo d # 部署到远程仓库
访问https://yourname.github.io查看结果
** 到此,整个博客搭建完成了 **
以下是写的是博客主题的更换,主题可以自己写,也可以使用别人写的,可去这里https://hexo.io/themes/找喜欢的主题,如果使用的是别人的主题,需要阅读主题使用文档进行相关配置。
cd进themes目录
cd themes
git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia
config_yml
文件进行修改cd themes/yilia
git pull #更新主题
hexo clean # 清楚缓存,删除public目录
hexo g # 生成新的博客静态文件
hexo s
去http://localhost:4000预览,没毛病就hexo d
部署到远程仓库。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有