Closed fmichonneau closed 2 years ago
When does _site
currently get created?
we currently rely on Jekyll to generate the GeoJSON files.
The _site
directory gets created last in the Makefile.
Right, but you can't cp
to _site
unless _site
already exists, right? So I was thinking it initially got created somewhere else. I tried adding mkdir _site
earlier on but that didn't work.
Also why would it not work to send everything to _data
? Why do plots need to get sent to _site
?
By sending everything to the _site
folder the files are directly available at the root URL (e.g., plot_instructor_teaching_frequency.svg
will become available at https://feeds.carpentries.org/plot_instructor_teaching_frequencyd.svg
). Keeping this flat structure makes things easier to manage.
Additionally, Jekyll doesn't make the files in _data
available (in other words, the _data
folder isn't included in the _site
folder generated by the jekyll build
command). That's why the JSON files that are generated in the _data
folder get copied in _site
. They need to be in the _data
folder because that's where Jekyll expects them and we use them to create the GeoJSON files.
but you can't cp to _site unless _site already exists, right?
Yes, you are right. That's why the Makefile will need to be reorganized to ensure that the _site
folder exists early enough to hold these files.
to keep the file structure clean, the output should all be generated outside the root of the repo:
_data
folder_site
folderNeed to adjust the scripts (make sure the files get written to
_data
) and the Makefile accordingly (make sure_site
gets created early enough to hold the artifacts).