Github Pages is Not Loading Specific Folders #22161
-
Hi all, I’m trying to use github-pages to host an online version of a spatial programming course, however the static files for stuff like CSS and JS aren’t loading properly. e.g. https://esda-spatial.github.io/Course-Site/tutorials/03)%20Working%20with%20Vector%20Data.html Whereas when I open the same file locally it appears like this: When I inspect the network tab I can see that the CSS and JS files are 404’ing when requested, and I can’t access them either - e.g. https://esda-spatial.github.io/Course-Site/_static/jquery.js. However, when I try accessing them directly from the repo everything is fine - e.g. https://raw.githubusercontent.com/ESDA-Spatial/Course-Site/master/_static/jquery.js Github pages itself has been set up to read directly from the root repository of the master branch as well. Any help solving this would be much appreciated |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey @AyrtonB, welcome to the GitHub Support Community! It looks like you’ve already managed to figure this out, but I’ll leave the answer just in case anyone else comes looking for solutions to a similar problem. GitHub Pages uses Jekyll to build sites by default. Jekyll doesn’t include directories that start with certain special characters when building and deploying your site, including About GitHub Pages and Jekyll - GitHub DocsIf you’re using Jekyll to build your site and would like to include a file or directory that Jekyll excludes by default you can do this by specifying the path to the file/folder inside the Configuration OptionsThe tables below list the available settings for Jekyll, and the various options (specified in the configuration file) and flags (specified on the command-line) that control them. If you’re not using Jekyll, and are building your site using pure HTML, CSS, and JS, or are using a different static site generator, you can disable Jekyll for GitHub Pages site builds altogether by creating a file called About GitHub Pages - GitHub DocsDoing either of these should make your site available on GitHub Pages. |
Beta Was this translation helpful? Give feedback.
-
Completely forgot about this until I just spotted the notifications whilst searching for something else just now, thank you for replying and posting the answer. Apologies for the poor etiquette. |
Beta Was this translation helpful? Give feedback.
Hey @AyrtonB, welcome to the GitHub Support Community!
It looks like you’ve already managed to figure this out, but I’ll leave the answer just in case anyone else comes looking for solutions to a similar problem.
GitHub Pages uses Jekyll to build sites by default. Jekyll doesn’t include directories that start with certain special characters when building and deploying your site, including
_
:docs.github.com
About GitHub Pages and Jekyll - GitHub Docs
If you’re using Jekyll to build your site and would like to include a file or directory that Jekyll excludes by default you can do this by specifying the path to the file/folder inside the
include
variable in your site’s_config.yml
file: