Deploying the Collection
So … Where are the files???!!!
One of the strange things about developing in this way is that while Jekyll is creating html files like its 1999, knowing where those files are and how to put them somewhere else is difficult to figure out. Let’s lift the veil:
Jekyll builds the website in a directory called “_site.”
While generating the files for development–so when you are looking at the site after entering
jekyll s in the commandline, the links it creates are based on that development server. But you’ll also need one more command to build the site for production. Typically, that comand is “jekyll build,” but we’ve added a few extra tasks to include analytics in a separate command called
1. Building the Site (“rake deploy”)
When you are all finished, go to the terminal in VS Code and click ‘CTRL C’ to stop your development server. Then, write ‘rake deploy’ and push enter. This does two things:
- It builds the site with the appropriate (full) links
- (so www.lib.uidaho.edu/digital/boxing/browse.html rather than http://127.0.0.1:4000/digital/boxing/browse.hml)
- It adds Google Analytics code based on the variable you added in the _config.yml file.
- This prevents false hits on your analytics account.
If you didn’t add analytics, that’s fine too. It will build your site just the same as
jekyll build does.
A Note on Google Analytics
We don’t necessarily recommend adding Google Analytics to your website. Last year, we actually deleted analytics from our catalog due to patron privacy concerns related to Google’s agrressive tracking of users online.
We do assume, however, a large number of our eventual users might use the tool to collect web statistics (we do on our other sites).
If you’re interested in an analytics tool that doesn’t track your users, we’ve enjoyed looking at Matomo recently. We haven’t added a Matomo option but we might add that or another analytics tool in the future.
2. Moving the _site Files to Your Web Server
One you’ve completed the build process, the web files you need will all be in your “_site” directory.
- Open that directory using your file explorer or finder.
- Copy everything you’d like to move into a production site.
- Paste those files and folders into the directory on your web server you’d like to serve this site from.
Note: If you’d like to serve this up from a GitHub Pages enabled repository, that also could be doable. Talk to us.
That’s it. You’ve Done It. And hopefully now you can do it again (and again and again), and after awhile, teach others this development model and/or tool as well. (Let us know if we can help!)