I recently hosted my Octopress blog on Github Pages. Trouble came when I tried to consult it via my custom url, http://example.org/
. CSS and JS did not load, as the browser console indicated.
I checked the page's source code and noticed the browser was told to look for the assets at the relative url (eg <link href="/mypath/favicon.png" rel="icon">
for the favicon), which indeed does not work since there is nothing there.
I solved my issue by setting the config_yml
"root" to http://example.github.io/mypath
, thus going against the octopress guidelines for deploying to a subdirectory (which is the case with my Project Page use of Github Pages) I was following till then.
This and the fact that viewers of my blog, which'll arrive via http://example.org/
will see http://example.github.io/mypath
as soon as they click on any of the first page links, clearly indicates that my setup is wrong.
I have seriously spent hours on this one, read through these SO questions, to no avail.
The right setup is :
url: http://example.org
root: /