(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)
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.
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 -prv --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:
First thing you should do is mv $NEW/compo_entries{,.old} — 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. You'll need to add ~/.gem/ruby/2.1.0/bin/ to your $PATH if it's not already there.
1. Install the jekyll gem and a few other packages personally:
gem install ruby_dep --user-install -v 1.3.1 gem install listen --user-install -v 3.0.8 gem install jekyll-watch --user-install -v 2.0.0 gem install jekyll --user-install -v 3.8.5
Although there are newer versions of jekyll, whelk/oyster have sufficiently old Ruby (2.1.5) that nothing newer will install.
2. 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 http://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/> and make changes to the files in <build/> to get them to be the same.
3. git commit -m "Match final version of 2014 site" all of the changes required to get the <build/> directory up to date. 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.
4. 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.
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 commit -a jekyll build cp -a _site/* ..