hexo博客上传github page

本文搬运自本人高中时期CSDN博客,若图片加载不出来,可到原文查看:https://blog.csdn.net/zhangtingxiqwq/article/details/161562364

  1. 在github上新建仓库,仓库名必须严格为 用户名.github.io, 并在setting里打开github page的设置

  2. _config.yml 加入:

1
2
3
4
deploy:
type: git # 部署类型,如 git, heroku 等
repo: https://github.com/2008zhangtx-oss/2008zhangtx-oss.github.io.git
branch: main
  1. git下载插件:
1
npm install hexo-deployer-git --save
  1. 终端上传:
1
2
hexo clean; hexo g; hexo d
hexod # powershell配置
  1. 终端由于网络上传失败,要去配代理
1
2
git config --global http.proxy http://127.0.0.1:17890
git config --global https.proxy http://127.0.0.1:17890

配完后可以取消:

1
2
git config --global --unset http.proxy
git config --global --unset https.proxy