Github 页面不显示我的 index.html

Github Pages doesn't show my index.html

我最近刚买了一个投资组合模板,并尝试将其安装到 github 页面中。它只会显示背景,但不会有图像或文本。

加载你的 index.html 很好,问题是当 github 默认使用安全 https 时,你的网页正在通过不安全的 http 加载资源,这会导致混合内容错误,所以一堆其他资源加载失败。

请注意,您的 Github 页面站点是通过 https 托管的,并且您的模板包含指向资源的纯文本 http links。您无法在安全的 https 连接中安全地加载纯文本 http 资源。您需要修复错误消息,例如:

Blocked loading mixed active content http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic”

注意以下 link 中从 httphttps 的转换:

<link href='https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Lilita+One' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Alegreya+Sans+SC' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>

还有一个 jQuery link:

<script src="https://code.jquery.com/jquery-latest.min.js"></script>

在相关说明中,您的存储库缺少 magnifique 弹出库。您可以将 URL 替换为 link 到 CDN。例如,更改此行...

<script src="js/jquery.magnific-popup.min.js"></script>

到这一行...

<script src="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js"></script>