html - 带有静态 html 的 gh-pages 存在时无法访问文件

标签 html github http-status-code-404 relative-path github-pages

index.html主页显示正常,但是任何链接都会抛出 404。

静态网站有包含 html 的文件夹,使用正确的路径索引这些 html 的链接,但显示 404。

当点击 this link 时,我得到了 404。

然而,该文件与您一样存在 can see here .

我真的在为一个简单的 html pb 努力,这令人沮丧。

最佳答案

我自己也遇到过这个问题,最后发现了一个更简单的解决方案。问题是 Jekyll ignores all files that start with _ .简单的解决方案是将 .nojekyll 文件添加到您的文档目录。

我的文档脚本如下所示: “rimraf ./docs && typedoc src/--out docs --mode modules --module commonjs --target es6 --excludePrivate && touch ./docs/.nojekyll && gh-pages -d docs -t”

touch 是一个创建文件的 npm 模块,gh-pages 上的 -t 标志是上传该点文件所必需的.

关于html - 带有静态 html 的 gh-pages 存在时无法访问文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39765059/

相关文章:

php - 重定向 404 或仅 404 header

asp.net - ASP.NET MVC 中的 404 页

github - 404 页面无法使用固定链接 : pretty using GitHub Pages + Jekyll

html - 中间带有图标的分隔线不会跨越 div 的宽度

html - 如何在列表框中放置滚动条?

jquery - FancyBox (fancyapps) 内容在顶部

git - 如何使用 Jenkins 为许多 repos 创建和推送新的 Github 分支?

javascript - gmaps v0.3 中如何自动打开信息窗口

git - 将 GitHub "Squash and merge"之后的分支重新设置为 master

github - Jupyter Notebook 文件上传到 Github 需要很长时间