gitHub pages odd behaviors with filename extensions

Behavior: file is returning 404 in subdirectory on github pages.

Behavior:  test.html shows rendering of  Actual test.html file is ignored.

Behavior:  test.txt renders test.txt {{ with variables parsed }} inside of _layouts/default.html file and then is converted to source text in the browser similar to view source.  (404) (returns & jekyll template, ignores file: test.html in same directory) (returns test.txt & jekyll template)

This is all expected behavior based on how Jekyll processes your repository during its build process. It’s not that the test.html file is ignored, it is just overwritten during the build process by the conversion of to test.html.

I hope that helps!

1 Like

It does help thank you.  Since that post I’ve modified the environment so that I can run   jekyll build  and actually see what is being generated in the ./_site/  directory.  That directory I believe is hidden on the github pages site so I didn’t previously notice generated static files & structure.  I was modifying and pushing w/o building locally.  So your response is correct, it works as designed.

Building locally also helps partially explain what is happening to ./docs/test.txt  -  That text file is getting processed with ./_layouts/default.html resulting in ./_site/docs/test.txt  (retaining the .txt extension).  So when the browser requests /docs/test.txt it is getting back the combined documents as html but served as  content-type: text/plain

1 Like