Static resources not loading on GitHub Pages

tusharmath picture tusharmath · Aug 2, 2013 · Viewed 12.8k times · Source

I have created a website and am trying to host it on git hub pages. My site is available at -

http://<username>.github.io/<project name>/

But the static files for my site are available at the following path -

http://<username>.github.io/css/site.css
http://<username>.github.io/script/main.js

The above path omits the <project name>

So whenever I hit the url my static files are not loaded.

Is there a way to make it work with the github url?

Note: When I use a custom domain everything works fine because the relative paths are fine in that case.

Temporary Solution I have created a User page instead of a Project page to overcome this issue.

Answer

tacaswell picture tacaswell · Jun 6, 2014

The other option is to include the file .nojekyll in your top-level directory which tells github to just serve your pages with out trying to break them (this is useful if you are trying to post the oputput from sphinx which does not need any more parsing/munging/rewriting).

relevant link