gpt4 book ai didi

javascript - node_modules 文件夹上的 Github Pages 404

转载 作者:可可西里 更新时间:2023-11-01 02:34:05 25 4
gpt4 key购买 nike

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

enter image description here

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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com