Hexo博客部署至GitHub Pages遇404错误求助
部署Hexo到GitHub Pages遭遇404错误求助
环境信息
- Node.js版本:9.7.2
- Hexo版本:6.3.0
本地与配置情况
- 本地执行
hexo server可正常生成页面,但本地Hexo目录无index.html文件(此前有该文件时部署仍失败) - 仓库命名正确,远程仓库处于main分支,已确保本地与远程仓库同步
- _config.yml中deploy配置:
# Deployment ## Docs: https://hexo.io/docs/one-command-deployment deploy: type: git repo: https://github.com/shioubi0216/shioubi0216.github.io.git branch: main
- _config.yml中URL配置:
# URL ## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project' url: https://shioubi0216.github.io/ permalink: :year/:month/:day/:title/ permalink_defaults: pretty_urls: trailing_index: true # Set to false to remove trailing 'index.html' from permalinks trailing_html: true # Set to false to remove trailing '.html' from permalinks
已尝试的解决操作
- 删除重建GitHub Pages仓库,无效
- 多次执行
npm install hexo-deployer-git --save安装部署插件 - 曾遇到Jekyll构建失败,设置
skip_render: true后问题仍存在 - 查阅GitHub Pages 404错误排查指南,页面状态显示正常
- 未使用自定义DNS
- 多次清除浏览器缓存并重启电脑
多次尝试以上方案均无法解决404问题,希望得到可行的解决办法。
内容的提问来源于stack exchange,提问作者Jheng Syu
相关产品推荐
相关产品推荐

