我正在尝试使用 GitHub 页面使用 JavaScript 在发布者-订阅者模块上呈现我的 GitHub 存储库。 gh-pages
分支看起来不错。但是, mustache 代码不会呈现在我在 GitHub Pages 上的项目中。它看起来像这样:
GitHub 存储库:https://github.com/ajhalthor/pubsub-application
此项目的 Github 页面 repo :https://ajhalthor.github.io/pubsub-application/
GitHub 存储库也有 node_modules
文件夹,所以它应该是自给自足的。 Mustache、jQuery 和 Bootstrap 包含在此文件夹中,因此没有外部链接或 CDN。
主要问题:即使所有路径都相对于项目的主文件夹指定,为什么 mustache 不渲染?
最佳答案
Github pages 使用的 Jekyll 版本默认忽略 node_modules
文件夹。
根据这个blog article .您可以执行以下操作:
Create an empty
.nojekyll
text file in the root of the gh-pages branch.
也可以引用这个announcement by github其中讨论了负责此行为的更新。
关于javascript - node_modules 文件夹上的 Github Pages 404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43481269/