I am new to Jekyll and started rebuilding our work group’s old website using version 3.8.5 (according to the lock file). This includes a lot of pdfs, videos and other static content, some of which is lecture slides with interactive material.
This content sits in a directory called “downloads” next to the source directory since the static files are not necessary for site generation. Inside _site I have a symbolic link to “downloads” which I also keep and exclude using “keep_files” and “exclude” in my _config file. There is no “downloads” in the directory that is being built into the target.
If I remove the symbolic link the page builds in around 9 to 12 seconds and starts the server immediately afterwards. Making changes takes around 7 seconds until they are built in. Once I put in the link (or just the whole “downloads” folder containing 6GB of small files) the build time stays around the same, but between Jekyll displaying build time and the server actually running around 8 minutes pass. My guess here is that the files in “downloads” in _site are still being watched which is a thing I entirely do not want.
If I then make a change in a single file Jekyll needs around 4 minutes more to actually tell me it made changes and finish the build. After this first hickup everything behaves quick and as usual. My second guess there is that Jekyll needs to construct some index structure once for the first update which lists all the files that are being watched in _site.
Both of these things are guesses, I have no idea how Jekyll actually works.
All of this won’t be a problem for actual deployment. I plan to let a hook start rsyncing “downloads” into the _site directory while I deploy the whole thing to the actual web server directory. It is however very cumbersome for testing and previewing the site offline.
There are other questions already asking how to avoid excluded files and directories being watched. As far as I could tell these did not get to a conclusion but instead found a workaround. The core problem was a bit different, too.
My current workaround is using a python SimpleHTTPServer to view the site and rebuilding manually every time I make changes. I’d like to avoid this on behalf of other people working on the site later on.
If you have any guesses what causes the problem and how to avoid it I would gladly appreciate those!
Thanks for reading and in advance for helping!