node_modules文件夹上的Github Pages 404 [英] Github Pages 404 on node_modules folder

查看:105
本文介绍了node_modules文件夹上的Github Pages 404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆