-
The Harvard Crimson Journalism Conferences website is a static site that is generated using Ruby. It is hosted out of an S3 bucket on AWS. So in order to make modifications to the site and to deploy it to S3, you need to ensure that you have the latest version of
ruby
installed alongside the latest version ofgem
(the package manager for Ruby). -
Make sure that you've already
git clone
d this repo to your computer and are currently in the home directory of the repo. -
Once you've installed Ruby and ensured that you have the repo locally, add these two lines to the bottom of your
~/.bashrc
to ensure that every gem is stored in a local directory.export GEM_HOME=~/.gem export GEM_PATH=~/.gem
-
Once you've done this, run the following commands:
source ~/.bashrc
(enables the environment variables set above)gem install bundler
(install a gem that helps with package management)bundle install
(installs all the required gems)
-
If any gem in particular gives you trouble during the
bundle install
process, you can try installing it directly withgem install [gemname]
.
-
In the home directory, run
bundle exec jekyll serve
. This starts up a local development server at http://localhost:4000 which hosts live changes to the static site. When you modify and save the files in any folder other than than _site, these changes will be visible on the site upon refresh. -
Note:
bundle exec jekyll serve
(or alternativelybundle exec jekyll build
) generates a folder called _site that contains the static files that are actually used to render the website. DO NOT MAKE MODIFICATIONS TO THE FILES IN THIS FOLDER. The folder is not checked into git because these files are automatically regenerated bybundle exec jekyll serve
orbundle exec jekyll build
. So any changes to this file will be overwritten the next time this regeneration occurs. -
Jekyll uses the Liquid templating language, which is fairly similar to Jinja and the Django Template Lanugage. The context for the templates is provided in _config.yaml. Note that you will have to restart the
bundle exec jekyll serve
command in order to observe any changes you've made to _config.yaml. -
Variables such the Crimson's current president are located in _config.yaml, so to get the president's name in a template, write
{{ site.president.name }}
. If you find yourself hardcoding a name, email address, or phone number in a template, consider adding that information to the yaml file and using Liquid instead. This makes it so that updates to the static files only need to happen in one in place, the config file, instead of in 20 different files. TL;DR: Use _config.yaml and Liquid often.
-
Once you're ready to deploy the site, run
bundle exec jekyll build
to generate the _site directory. The files in this folder are the ones that S3 actually hosts. -
The
s3_website
gem should already be installed as a result of thebundle install
command above, but if it isn't then install it usinggem install s3_website
. -
bundle exec s3_website cfg create
creates a new s3_website.yml. Put in your AWS credentials (same as with the normal website) and conferences.thecrimson.com or programs.thecrimson.com as the bucket. -
bundle exec s3_website cfg apply
configures everything for you. -
bundle exec s3_website push
deploys the code to the website. If prompted to use CloudFront, say yes. If you've already configured s3_website, then you can can skip directly to this step after runningbundle exec jekyll build
. -
Check http://programs.thecrimson.com to verify that the site has been updated!