404 for specific js files

Hello, I’m having some trouble with certain scripts getting 404, even though they’re present and public in the repo.

Here’s an example:

https://tanpike.github.io/sphinxtst/build/html/index.html

  calls the following script, which gets a 404 error:

https://tanpike.github.io/sphinxtst/build/html/_static/bootstrap-sphinx.js

  even though that script is there in my repo:

https://github.com/tanpike/tanpike.github.io/blob/master/sphinxtst/build/html/_static/bootstrap-sphinx.js

The index.html file calls about 12 other js files which are also 404’ing

If i view this directory on my local machine, (using a local web server) it loads the scripts just fine and renders properly.

Thanks for any insights or assistance!

UPDATE: I’ve figured this out. My js files were living in the _static directory. By default, github pages will disregard directories that begin with an underscore ( _ ) as part of its jekyll processing. You can bypass that by putting an empty .nojekyll file in the top level of your repository.  This blog entry was the one that help me understand.

1 Like

Hello, I followed the step discussed here https://github.com/sphinx-doc/sphinx/issues/3382. Things work fine.
Page preview. https://lylelee.github.io/tanpike/

  1. mkdir docs
  2. edit Makefile, add github target in the end
    github:
        @make html
        @cp -a ./"$(BUILDDIR)"/html/. ../docs
    
  3. build and commit
    make github
    git add .
    git commit
    
  4. Chose master branch /docs folder at Github pages setting from your repository