Github 浏览器预览不显示滑块,也不显示 bootstrap 图标
Github browser preview doesn't show slider nor bootstrap icons
我是 GITHUB 和 NODE.js 的新手,我曾尝试在 GITHUB 上发布一个页面,但我看到它的方式与它显示的方式不同在我的本地主机上。
基本上在 GITHUB link 中我看不到我使用的 OWL 旋转木马,也看不到 Bootstrap 图标。在我的 LOCALHOST 中它工作正常。
我在这里错过了什么?
网页:https://lfavilla.github.io/rastelli/
存储库:https://github.com/lfavilla/rastelli
您的资源正在从 node_modules
加载,这在 git 集线器上不可用,它不应该在 git 上可用。
您正在尝试加载类似 https://lfavilla.github.io/rastelli/node_modules/jquery/dist/jquery.slim.min.js
的资源
运行 npm run build
在您的项目上并使用构建文件夹 git 更新
在您的 index.html 文件中使用 jquery
的 CDN 版本
改变
<script src="node_modules/jquery/dist/jquery.slim.min.js"></script>
至
<script src="https://code.jquery.com/jquery-3.6.0.slim.js"></script>
此外,将您的 bootstrap 图标引用更改为 CDN
https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.0/icons/chevron-down.svg
您可以在此处找到图标 CDN https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.0/icons/
我是 GITHUB 和 NODE.js 的新手,我曾尝试在 GITHUB 上发布一个页面,但我看到它的方式与它显示的方式不同在我的本地主机上。
基本上在 GITHUB link 中我看不到我使用的 OWL 旋转木马,也看不到 Bootstrap 图标。在我的 LOCALHOST 中它工作正常。
我在这里错过了什么?
网页:https://lfavilla.github.io/rastelli/ 存储库:https://github.com/lfavilla/rastelli
您的资源正在从 node_modules
加载,这在 git 集线器上不可用,它不应该在 git 上可用。
您正在尝试加载类似 https://lfavilla.github.io/rastelli/node_modules/jquery/dist/jquery.slim.min.js
运行 npm run build
在您的项目上并使用构建文件夹 git 更新
在您的 index.html 文件中使用 jquery
的 CDN 版本改变
<script src="node_modules/jquery/dist/jquery.slim.min.js"></script>
至
<script src="https://code.jquery.com/jquery-3.6.0.slim.js"></script>
此外,将您的 bootstrap 图标引用更改为 CDN
https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.0/icons/chevron-down.svg
您可以在此处找到图标 CDN https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.0/icons/