node_modules文件夹上的Github Pages 404 [英] Github Pages 404 on node_modules folder
问题描述
我正在尝试使用GitHub页面在JavaScript上的Publisher-Subscriber模块上呈现GitHub存储库. gh-pages
分支看起来不错.但是,髭代码不会在我在GitHub Pages上的项目中呈现.看起来像这样:
GitHub存储库: https://github.com/ajhalthor/pubsub-application >
该项目的Github Pages回购: https://ajhalthor.github.io/pubsub-application/
GitHub Repository也有node_modules
文件夹,因此它应该是足够的.小胡子,jQuery& Bootstrap包含在此文件夹中,因此没有外部链接或CDN.
主要问题:即使指定了相对于项目主文件夹的所有路径,为什么也没有胡子渲染?
Github页面使用的Jekyll版本默认情况下会忽略node_modules
文件夹.
根据此博客文章.您可以执行以下操作:
在gh-pages分支的根目录中创建一个空的
.nojekyll
文本文件.
您还可以参考https://github.com/ajhalthor/pubsub-application
Github Pages Repo for this project : https://ajhalthor.github.io/pubsub-application/
The GitHub Repository also has the node_modules
folder, so it should be self sufficient. Mustache, jQuery & Bootstrap are included in this folder, so there are no external links or CDNs.
Main Question : Why isn't mustache rendering even though all paths are specified relative to the project's main folder?
Github pages uses a version of Jekyll that ignores node_modules
folder by default.
According to this blog article. You can do the following:
Create an empty
.nojekyll
text file in the root of the gh-pages branch.
You can also refer to this announcement by github which talks about the update that is responsible for this behavior.
这篇关于node_modules文件夹上的Github Pages 404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!