(The following is from an email by scgruber in 2015, with light edits by tparenti in 2017, and updates for newer Jekyll by lroop in 2019, and further edited by tparenti in 2023 and 2025)
There is in fact more to that site than meets the eye. The Demosplash website is a Jekyll site, stored in /afs/club/www/demosplash/build/. Here's how to use it:
To archive an old year's site
Archive the current site into the old <20xx/> directory. You'll want to change a bunch of links to make this happy, but it shouldn't take too long. Specifically:
Check disk quota before archiving! Running out will make you sad.
In particular, run fs lq . and du -s compo_entries to get a good sense of whether there is enough space, since compo entries tend to take up the bulk of it.
Set vars, e.g., OLD=2019 ; NEW=2020
Copy all the files (but not previous archives or the git repo) into a new directory: rsync -arv --exclude '20*' --exclude 'build/.git' . $OLD.backup/
- On HTML files in the newly-archived folder, replace all absolute links to where the archived versions will live.
Find and replace hrefs beginning with /, except where a year is already explicitly specified, with something like:
for file in $( tree $OLD.backup --nolinks -I "compo_entries|build" -f -i | egrep ".html$" ) ; do perl -pi -e 's;href="/(?!20\d\d);href="/'"$OLD"'/;g' $file ; done
This will help ensure that all internal links, including the masthead, as well as statically-loaded assets, especially logos and CSS in /static are kept pointing to the old year's archived version, while the new site can move onward.
Note that this uses perl regular expressions for their negative-lookahead feature, instead of native sed.
- Move the backup directory into its final location and add a symlink to point the new year to the current directory:
Assuming the proper symlink already exists 20xx -> . …
Do this as atomically as possible with rm $OLD ; mv $OLD{.backup,} ; ln -s . $NEW
- Now, you're good to mutate the main site for the new year:
After verifying that $OLD/compo_entries exists and contains what it's expected to, first thing you should do is rm -rf $NEW/compo_entries ; mkdir -p compo_entries — since there are not yet any compo entries for the new year, and leaving the old ones around will get confusing right after the new year's event when people keep hitting refresh.
Note: It's probably better to use something like the HTML5 <base> tag for this, but unfortunately most links are absolute, rather than relative.
To edit the current site
0. Read through the Jekyll docs and our source files to get a sense for how the site works. The Jekyll docs are organized pretty poorly, but short, so I recommend just reading straight through the whole thing in one pass before you get started.
1. Make changes in your own local copy of the repo at /afs/club/git/demosplash-www and push them to it:
git clone /afs/club/git/demosplash-www # edit files git commit -a git push origin main
2. Log into conch.club.cc.cmu.edu. As of 2023, it has a modern jekyll installed by default. Navigate to </afs/club/www/demosplash/build>.
3. Pull in the latest changes from the centralized repo using git pull origin main
4. Use jekyll build to render the current files into <build/_site>. This is a staging area so that you can modify the site and check it at https://demosplash.org/build/_site to make sure things look okay. Compare the files in _site to the files we're actually showing from </afs/club/www/demosplash/>. If needed, make changes to the files in <build/> to get them to be the same, but don't forget to commit and push back to the main repo. Inevitably people forget to track things in git properly, and that makes me sad. You should use git because it will make your life easier when someone inevitably does a stupid. Note that the repo is in <build/> and does not track <build/_site/> for obvious reasons.
5. When you actually make real changes, first render them with jekyll build and look at them in <_site/>. Then copy the files you wanted to change out of <_site/> into the appropriate place in </afs/club/www/demosplash>. We don't have a convenient script to do this yet (though you could write one pretty easily!).
- In particular, if you know everything looks great and you're feeling bold, the following will ensure that nothing is missed (but also nothing old is kept!):
cd /afs/club/www/demosplash/build git pull origin main jekyll build cp -a _site/* ..