Troubleshoot inability to reference nested data on GitHub pages
Closed this issue · 4 comments
Data stored in nested directories within the top-level GitHub pages directory cannot be accessed as expected. This means all data and code currently has to live in the top-level directory.
Interestingly, this nesting problem does not occur when testing locally with http-server
.
just as a reminder, if we figure this out we should update the README
Looking into this more, I wanted to take some notes about what is maybe happening.
- GitHub Pages renders sites with Jekyll by default. This default behavior can be disabled by adding an empty
.nojekyll
file to the top of the repo. - Jekyll excludes all directories that start with a
_
(e.g.,_data
) by default. - Jekyll can be configured with a _config.yml file to explicitly allow directories like
_data
to be exported from its build process
I tested the idea of explicitly allowing the _data
directory to be exported with this commit and it worked.
However, it might be clearest for future maintainers to merge the docs repo with this repo and continue to serve the docs with Jekyll even though the main app is not using Jekyll. Since we don't actually use the _data
and _javascript
directories as they are designed for Jekyll, maybe we can move our data and source code into data
and javascript
directories (no leading underscores) to get around this Jekyll issue completely.