Github node_modules 文件夹中的页面 404

Github Pages 404 on node_modules folder

我正在尝试使用 GitHub 页面在 JavaScript 的发布者-订阅者模块上呈现我的 GitHub 存储库。 gh-pages 分支看起来不错。但是,小胡子代码不会在我的 GitHub 页面上的项目中呈现。看起来像这样:

GitHub 存储库:https://github.com/ajhalthor/pubsub-application

Github 此项目的页面回购:https://ajhalthor.github.io/pubsub-application/

GitHub 存储库也有 node_modules 文件夹,所以它应该是自给自足的。 Mustache、jQuery 和 Bootstrap 包含在此文件夹中,因此没有外部链接或 CDN。

主要问题:即使所有路径都相对于项目的主文件夹指定,为什么小胡子不渲染?

Github 页面使用默认忽略 node_modules 文件夹的 Jekyll 版本。

据此blog article。您可以执行以下操作:

Create an empty .nojekyll text file in the root of the gh-pages branch.

您也可以参考此 announcement by github,其中讨论了导致此行为的更新。