[英]How do I link pages in GitHub Pages
本质上,我正在尝试将我的 GitHub 页面 index.html 文件链接到存储库中的其他文件以创建多页面网站。
URL 是正确的,我尝试了很多方法,但我只是无处可去。 主分支称为 home,其中是 index.html 文件,以及其他文件,见下文:
html 文件内的链接是:
<li class="masthead__menu-item">
<a href="https://xxx.github.io/home/research/">Research</a>
</li>
文件“研究”位于主分支内。 我尝试将其命名为“research.html” 我尝试从上面的链接中删除“home”,以便它直接链接到研究,见下文:
<li class="masthead__menu-item">
<a href="https://xxx.github.io/research/">Research</a>
</li>
似乎没有任何效果。 我究竟做错了什么?
查看屏幕截图和您提供的 html ,我没有看到您尝试链接到的文件名称后面的任何 *.html 扩展名。
例如:尝试将文件“research”重命名为“research.html”
If the file is a html file then the problem is with the address of the URL ie https://xxx.github.io/research/
in <a href="https://xxx.github.io/research/">Research</a>
。
最后一个斜杠导致了问题。 去掉地址的最后一个斜杠,即https://xxx.github.io/research
,就是<a <a href="https://xxx.github.io/research">Research</a>
="https://xxx.ZBF215181B5140522137B3D4F6AZResearch./ioresearch.
经过几个小时的尝试,我终于让它工作了:
<li class="masthead__menu-item">
<a href="xxx.github.io/research.html">Research</a>
</li>
我所做的是摆脱“家”并使页面成为 html 文件。 谢谢 iamabdm 和 minwka!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.