I am hosting a static application on GitHub pages. My application structure is like this - I have some front-end facing files, and some Python files that are run periodically to get the data for the front-end, but should not be user-facing:
index.html
/js
index.js
vendor/
/css
/data
get_data.py
How can I stop everything in data/
being publicly available on the website?
You have two main options:
Option 1: Rename your
data
directory to_data
.Jekyll ignores files and directories that start with an underscore. You could also create a top-level
_backend
directory and then move yourdata
directory into that.Option 2: Configure your Jekyll to exclude the
data
directory.You can add an
exclude
setting to_config.yml
to tell Jekyll to ignore yourdata
directory.From the configuration documentation:
Googling "jekyll underscore directory" returns a ton of results, including this one which explains all of the above: https://help.github.com/articles/files-that-start-with-an-underscore-are-missing/