Search code examples
githubgithub-pages

Github pages 404ing on single file


I have a built react app in the docs directory of my project. The project is set to have it's github page source to that directory. All that works fine.

https://pgooch.github.io/find-your-ross/#/

As you can see, it all works, notably the image assets, which are located here.

https://github.com/pgooch/find-your-ross/tree/master/docs/static/media

While all of that works absolutely great, the markdown file in that directory 404's.

https://pgooch.github.io/find-your-ross/static/media/_linked_readme.d73385c3.md

The file appears in the repo as you'd expect (it's at the very bottom of the list). I have; waited more than 8 hours, tried different browsers on different devices, and checked that the permissions were good, confirmed that the file names were cased the same. No difference. This file 404s when viewed directly or fetched (as can be seen by clicking about).


Solution

  • The reason why the _linked_readme.d73385c3.md file is not coming up on GitHub pages is due to Jekyll ignoring the file which has a name starting with an underscore.

    If you are not using Jekyll, just add an empty .nojekyll file within the docs folder. You can just create the file and commit it on GitHub UI or create the file on your local machine, commit it and push it to the GitHub repo. Once the file is added within the docs folder, the _linked_readme.d73385c3.md file will come up on your GitHub pages site.

    Or if you have the option of renaming your file, just drop the underscore at the beginning of the file and rename it from _linked_readme.d73385c3.md to linked_readme.d73385c3.md.

    Reference: GitHub