使用Github托管的方式(git):
- 首先配置
_config.yml文件的相关内容
deploy:
type: git
repo: [email protected]:yourname/yourname.github.io.git # 注意这里
branch: main清除缓存并部署
# 彻底删除部署文件夹(在 Hexo 根目录)
rm -rf .deploy_git
# 重新生成并部署
hexo clean
hexo g
#当使用本地推送静态文件的时候可以使用
hexo d配置好用户和密钥并且在账户里粘贴SSH密钥的pub key
git config --global user.name "你的GitHub用户名"
git config --global user.email "你的注册邮箱"
ssh-keygen -t ed25519 -C "你的GitHub邮箱@example.com"推送到上面
git add .
git commit -m "新文章"
git push origin main