我用 jekyll 建立了自己的网站并将其上传到 git 但我遇到了问题。 我在 youtube 上遵循了有关如何上传网站的指南:https://www.youtube.com/watch?v=fqFjuX4VZmU&list=PLLAZ4kZ9dFpOPV5C5Ay0pHaa0RJFhcmcB&index=19
这是实际网站的链接:https://linus345.github.io/portfolio/
这里是 github 存储库的链接: https://github.com/Linus345/portfolio
该网站位于分支 gh-pages 上,您希望看到的错误是:
Error 404 page not found
我该怎么做才能解决这个问题?如果您需要更多信息,请发表评论。
编辑: 我怀疑永久链接/链接可能存在一些问题,因此它不起作用,但我无法弄清楚。
最佳答案
YouTube 视频中使用的命令是:
git push origin gh-pages
这将创建一个 gh-pages
branch ,但即使是你的主分支在这里也应该足够了。 (自 2016 年 Aughist 以来,以及新的“Simplified Publication”)
但是,您的 Assets URL 是在绝对路径中生成的 (/assets/img/Blogit_Logo%20kopia.png
)
转化为 404:
https://linus345.github.io/assets/img/Blogit_Logo%20kopia.png
代替
https://linus345.github.io/portfolio/assets/img/Blogit_Logo%20kopia.png
参见“Customizing CSS and HTML in your Jekyll theme”和example repo minima .
关于html - 将 jekyll 网站发布到 github pages,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48482008/