我最近在Github Pages上主持了我的Octopress博客。当我尝试通过我的自定义网址http://example.org/
进行咨询时遇到了麻烦。正如浏览器控制台所示,CSS和JS没有加载。
我检查了网页的源代码并注意到浏览器被告知要在相对网址上查找资产(例如<link href="/mypath/favicon.png" rel="icon">
为favicon),这确实不起作用,因为那里什么都没有
我通过设置config_yml
&#34; root&#34;解决了我的问题。到http://example.github.io/mypath
,因此违反octopress guidelines for deploying to a subdirectory(我的项目页使用Github页面就是这种情况)我一直关注到那时。
这个以及我的博客的观看者通过http://example.org/
到达后,只要点击任意首页链接就会看到http://example.github.io/mypath
这一事实清楚地表明我的设置是错的。
答案 0 :(得分:0)
正确的设置是:
url: http://example.org
root: /